structured data for file...
[1/3] from: djo::wanadoo::fr at: 29-Jun-2003 19:19
Hi, in Visual basic, we build data for file : TYPE enrtruc name as string * 10 adress as string * 150 .... END TYPE DIM SHARED truc as enrtruc and use this in direct acces disk file : put #1, i, truc I have more difficult to apply a same structure in Rebol. I want quit Visual Basic, but i must convert more programs for that.... Thanks to clear up me... (sorry for my poor english...) A+ DJO
[2/3] from: greggirwin:mindspring at: 29-Jun-2003 13:13
Hi Denis-Jo, I moved to REBOL after 11 years as a VB specialist, so it can be done! :) The first question is whether you need to support your old data files or if you just want to know how to persist records to disk in REBOL. Andrew Martin has a script in hte library called fixed.r that takes fixed width data and splits it up into REBOL values. The SAVE and LOAD functions can be used to easily persist data but there is no direct equivalent in REBOL for VB's random access mode with fixed length structures. REBOL has no concept of fixed length strings, so even the struct! datatype that you use to interface to DLLs isn't an *easy* solution. I didn't say "impossible" because, while I haven't done it, there might be a way to do it, but at the expense of a little pain and suffering. :) I can see writing a dialect that would work like VB's random mode, except for one particular bug in REBOL (there aren't many, but this one kills me). You can't skip to random locations in a file that is open for direct access (i.e. non-buffered). Unless you have really large data files, buffered access should be just fine. Just load the data from the file (into a block, hash, etc.), work against that, then save the entire thing when you're done. If you can give us more specifics, maybe we can provide more detailed help. -- Gregg
[3/3] from: Al:Bri:xtra at: 2-Jul-2003 18:48
> The first question is whether you need to support your old data files or
if you just want to know how to persist records to disk in REBOL.
> Andrew Martin has a script in hte library called fixed.r that takes fixed
width data and splits it up into REBOL values. And it works very, very well in interpreting BASIC data files! :) The version in the library is a little out of date now. Email me directly for the latest and greatest version. Andrew J Martin ICQ: 26227169 http://www.rebol.it/Valley/ http://Valley.150m.com/