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

Why this error message?

 [1/4] from: louisaturk::eudoramail::com at: 7-Jul-2001 21:49


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 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: Trace: clear (word) Trace: database (word) Result: [] (block) Trace: if (word) Trace: data (word) Trace: [ foreach item data [ item: make record item repend database [item/name item] ] ] (block) Trace: foreach (word) Trace: data (word) 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
>>
Any idea what the problem might be? Louis

 [2/4] 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
<<quoted lines omitted: 13>>
> if exists? db-file [ > data: load/all db-file
i would suggest data: REDUCE load/all db-file see below
> clear database > if data [
<<quoted lines omitted: 8>>
> 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
<<quoted lines omitted: 12>>
> 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

 [3/4] from: louisaturk:eudoramail at: 8-Jul-2001 1:12


Hi Volker, At 05:36 AM 7/8/2001 +0200, you wrote:
>i would suggest > > data: REDUCE load/all db-file
That seems to have solved my problem! Many thanks! Louis

 [4/4] from: louisaturk:coxinet at: 7-Jul-2001 18:42


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 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: Trace: clear (word) Trace: database (word) Result: [] (block) Trace: if (word) Trace: data (word) Trace: [ foreach item data [ item: make record item repend database [item/name item] ] ] (block) Trace: foreach (word) Trace: data (word) 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
>>
Any idea what the problem might be? Louis

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted