BASIC

Author Topic: array2file / file2array  (Read 1204 times)

Offline Marmor

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 908
  • 96A285CC
    • View Profile
    • my youtube channel
array2file / file2array
« on: 2012-Aug-02 »
flen = getfilesize(xyz)
DIM dat% [flen]
file2array (xyz,dat%)
and reverse....

what do you think about the idea ?

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3366
  • Integrated Brain
    • View Profile
Re: array2file / file2array
« Reply #1 on: 2012-Aug-02 »
Hi think it´s nice idea... for write quikly into a file... I only add the string for the name file...

PS: A don´t understand well the code, because you say getfilesize, but i suppose it´s for get the data of the .txt or dat and put into an array?¿...


Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10697
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
array2file / file2array
« Reply #2 on: 2012-Aug-02 »
You eant to serialize an array. Int/float/string OK?
Binary or ascii?

MrTAToad

  • Guest
Re: array2file / file2array
« Reply #3 on: 2012-Aug-02 »
Would probably have to be a version for each type of variable.  Will be be comma seperated or not though ?

Offline Marmor

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 908
  • 96A285CC
    • View Profile
    • my youtube channel
Re: array2file / file2array
« Reply #4 on: 2012-Aug-02 »
are not all just bytes?
the array definition, I would let the programmer ?