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

Gian bagoneo at ...69...
Wed Mar 11 17:04:13 CET 2015


Il 11/03/2015 14:12, Tobias Boege ha scritto:
> 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
>>
>

Hello Tobias,
I would like to clarify this:
My example comes from a discussion of the Italian forum where some said 
that in Gambas there is no concept of random with fixed-length strings.
I counseled the use of a database. :)

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

This I was already said, but I do not understand what it would be easier 
in my example using the structure.
If the structure add a fixed array as you can have dynamism?
How can you change the single data in the record, without changing the 
whole file?

> 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.

I agree but I think a database is better :)

Thank you very much
Gianluigi






More information about the User mailing list