Page 1 of 1

Library stack - New user surprise

Posted: Sat Sep 25, 2010 10:41 am
by Simon Knight
I offer the following observation so that someone else may avoid several hours of head scratching :

While trying to write my first large application I have started experimenting with library stacks. Some of my functions load data from disk. For a quick and dirty check of what my code has loaded I added a field "debug" to my library stack/card and added a line of code to write the text into the field. However, when run the function throws an error reporting that the field can not be found.

Code: Select all

put c138Fields into field "debug"
The reason? The code looks for the field "debug" on the card/stack that invoked the routine not the stack where the code is stored.

I suspect that I have caused the "problem" by only using short names for the field.

Re: Library stack - New user surprise

Posted: Sat Sep 25, 2010 10:46 am
by Klaus
Hi Simon,

yes, when starting a command like the one above, Rev will check if the currently active card
of the currently active stack (the defaultstack) does have a field named "debug" and will of course
complain otherwise :D

So you need to:
1. add a long descriptor (...fld "debug" of cd 1 of stack "xyz")
OR
2. set the defaultstack first to the sack with that field:
...
set the defaultstack to "the one wiht the debug field in it"
put c138Fields into field "debug"
...


Best

Klaus