Open FileName for random as freefile

  • 19 years ago

    HELP !!!!
    OK,,, here is the problem


    I use random acces files,, i love them , they r easy... however they hav just stoped working !!


    I have made a program, it saves 3 records,,, 1,2 and 3


    IT saves text,, somethimes this text is verry long, so i have to specify a lenght


    eg


    Open FileName for random as freefile len = ???
    when saving it is easy,, i use  Len = LenB(txtvariable)


    however,,, when it comes to opening I do not know what length to use,, as it could be any,,,,, SO,,, when saving,, in record 2, i save the number of bytes needed ( LenB(var))  


    SO,, when it is time to open First i open the file without specifieng a len,,,, then i open record 2 and save it in the variable ILEN,,,


    so then i close the file, and re open it and specify a len = ILEN


    BUT,, whenever i use  GET freefile,2,ilen
    it stores "" in the variable !!! EVEN though  it put say  100 in the file !!!


    WHY ??? I can save text,, but not Numbers ?? I have declaired all my variables correctly and still cant work it out !!  PLEASE HELP !!!


    I have even tried to convert the number to  a string,, save it,,, then reverse this when i open it,, it still doesnt work ??


    Is there an easyer way of doing this ???
    or are the pixies just againsed me ????


    PLEAS please please help,, ive been at this problem for houres !!!

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Weeks of coding can save you hours of planning.”