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

[REBOL] How does one persist data? Re:

From: cybarite:sympatico:ca at: 11-Oct-2000 5:37

For storing the post or get data, I added a key and a timestamp and stored the name=value pairs on a file (%journal.txt). Then I could use the same approach for fields whether they came from the journal for a previous post or a new record from a user write/append %journal.txt reduce [ {confirmation-number=} confirmation-number "&timestamp=" now "&status=new" "&" system/options/cgi/query-string newline ] When I wanted to look it up in another script, requests: read/lines %journal.txt Find the requests that matches the confirmation-number or other criteria and instantiate a cgi object using the same approach: selected-query-string: pick requests some-key ; some-key is used to pick off one of the journal entries data-record-object: make object! [ ;-- Default form values. status: "None" timestamp: "None" confirmation-number: "None" name-last: "No name entered" name-first: "Not entered" card-number: "Not entered" special-instructions: "None entered" customer-request: "None entered" email: "None entered" refer-to: "None specified" special-instructions: "None" ] record-object: make data-record-object decode-cgi-query selected-query-string Now use the record-object data in your script such as record-object/status Worked for me!