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

[REBOL] Re: Why this error message?

From: agem:crosswinds at: 8-Jul-2001 5:36

RE: [REBOL] Why this error message? [louisaturk--eudoramail--com] wrote:
> Hi friends, > > I have added some fields to the database you all have been helping me > with. I can still add records to the database, then modify the records as > before. After exiting the database I can print the data file and the data > is (or at least seems to be) correct. But when I start the database > program (ml-db.r) again it cannot load the data file, and it gives the > following error message: > > >> do %ml-db.r > ** Script Error: Invalid argument: make > ** Where: load-data > ** Near: item: make record item > repend > >> > > This message is related to Carl's function: > > load-data: has [data] [ > if exists? db-file [ > data: load/all db-file
i would suggest data: REDUCE load/all db-file see below
> clear database > if data [ > foreach item data [ > item: make record item > repend database [item/name item] > ] > ] > database: make hash! database > ] > > ] > > If I turn trace on, and then run the program, the last part of the trace is > as follows: >
snip some tracing
> Trace: [ > item: make record item > repend database [item/name item] > ] (block) > Trace: item: (set-word) > Trace: make (word) > Trace: record (word) > Trace: item (word) > ** Script Error: Trace: "Invalid argument:" (string > ) > Trace: :arg1 (get-word) > Invalid argument: make > ** Where: load-data > ** Near: item: make record item > repend > >> >
[;this produces the same error record: context [] item: 'make trace on item: make record item ] Result: (unset) Trace: item: (set-word) Trace: make (word) Trace: record (word) Trace: item (word) ** Script Error: Trace: "Invalid argument:" (string) Trace: :arg1 (get-word) Invalid argument: make ** Where: do-boot ** Near: item: make record item
>>
i expect your db-file looks like make object! [..] make object! [..] .. ? if rebol only loads , it gets [2 words, a block, 2 words, a block ..] this is source-code to produce the objects. to get objects, you have to "compile" it. this is done with reduce. unfortunally it looks the same when probing the block. try probe type? first data with object! is it ok, with word! it needs reduce
> Any idea what the problem might be? > > Louis >
happy data ;-) Volker