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

[REBOL] Re: Object Database

From: louisaturk:eudoramail at: 11-Apr-2001 1:47

Dear Carl, I am amazed that such a small amount of code can do so much, and also that the creator of this language himself would help me like this. Many thanks! I have some questions. I have been studying your code carefully trying to learn how it works. I've been on this list for quite a while, but have only recently taken time to buy Ralph's book and Elan and John's book to really get serious about learning the language. I'm a real beginner, so please excuse me if my questions betray that fact. So far I have figured out how to use your functions to enter data into a record, and then save it to a file. By entering "print read %data.r" at the command line, I am able to see that I have entered the data successfully. So I think I understand how to use insert-data and save-data. However, when I type load-data I get an error message ("blk has no value"); what am I doing wrong? Also, I assume that I must learn how to get load-data to work before find-data and remove-data will work; but to keep from having to ask you later, how are these two functions used? I want to use this database for an email list. Most of the data remains the same, but email addresses change often. Sometime I do not even have a name---only an email address that has to be removed or changed. How do I change an email address? You say:
> If you expect to grow this database to a large >size, you will want to MAKE HASH! the database when you load >it.
Will this modification do it?:
>load-data: has [data] [ > data: make hash! load/all db-file > clear database > foreach item blk [ > item: make record item > repend database [item/email item] > ] >]
Will your code work with Rebol/View also? Am I correct in assuming that View would be ideal for creating a user interface for the database? Many thanks for your help, and for creating a truly exciting language. Louis At 08:28 AM 4/9/2001 -0700, you wrote:
>What!? You just want us to just whip out an object database, eh? ;)
Well, I wasn't expect anyone to whip out one especially for me,