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

[REBOL] Rebol Config/INI File Difficulty

From: rsnell:webtrends at: 2-Aug-2000 9:50

I'm trying to do something that Rebol should handle so easily but it's taking me way too much time so I could use a couple of tips to get going. I have a small DB that I usually (in C++) construct by using an INI (Win32) file - where each section is a new record and it has some number of keys/values. I now want to change the format of this INI file so that it takes full advantage of the Rebol do/load and save mechanisms. An example of the DB - this is what the file (myp.dat) should look like after it is built (it doesn't exist initially): myprops: [ db [ "item1" [x1 "x1" y1 "y1"] "item2" [x2 "x2" y2 "y2"] ] other ["junk" ] ] Simple enough. So what I want is to use 'do to bind myprops so I can directly use it and then use 'save to save the block after modification. I'm just not sure the best way to do this kind of thing because 'save won't place the myprops: assignment in the file. either (exists? %myp.dat) [do %myp.dat] [myp: [db ["item1" [...] "item2" [...]] other[]]] probe myp/db ; modify myp/db as needed save/header %myp.dat myprops [] The problem is the result file just contains the db [] and other [] blocks. I can't get myprops: into the file. That would be fine if I could assign myprops to the result of the 'do or 'load like: myprops: [do %myp.dat] but I don't know how to make that work (get Rebol to 'do and place the result in the block - not to put the literals in the block). Any ideas? How are you guys accomplishing similar things? TIA, Rodney