Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: structured data for file...

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