[Gambas-user] Random access files with fixed-length string

Tobias Boege taboege at ...626...
Wed Mar 11 14:12:10 CET 2015


On Tue, 10 Mar 2015, Gian wrote:
> Hello everyone,
> those coming from the Windows VB, frequently asks how to work with random
> access files with fixed-length string.
> I created this demo as an explanation and would like to know if you think
> right, correct in part or completely wrong.
> Thank you for attention
> 

Looks good. But, as you mentioned in the project description, it would also
be possible, and easier, to use Structs, as we did[0].

Also, if someone came to me and said: "in VB I used to store data in a non-
human-readable binary format. I want to continue doing so", I would briefly
mention that this is not *necessarily* a nice move and plain text files are
much more welcome in general. Also, if you are GNU-affine, they say[1]:

  "[...] Unix programs often have static tables or fixed-size strings, which
   make for arbitrary limits; use dynamic allocation instead."

If you create a new file format for your application, there are gb.settings
and gb.xml to consider first which provide these things already.

Regards,
Tobi

[0] http://gambaswiki.org/wiki/app/struct-db
[1] https://www.gnu.org/prep/standards/html_node/Reading-Non_002dFree-Code.html#Reading-Non_002dFree-Code

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk




More information about the User mailing list