put into named field weirdness

Russell Martin russell_martin at yahoo.com
Mon Feb 11 10:36:34 EST 2008


It's really bizarre.

I created a new project. Put 2 fields on the card. Named them. And then
put code like the following:
  put "hello, world." into field "SomeNamedField"
  put "hello, again" into field "AnotherNamedField"

.. into an openStack handler in the stack script, and, no problems.

Went back to my more complex project and used various methods of
ensuring that both my preOpenStack and openStack handlers that are in
the stack script of the main stack are only getting called once and the
code in them only executes when they are called due to the main stack
opening. The two methods I used are:

-- the stiff in square brackets is just generic, example
-- my real code had real stuff there
if the short name of this stack is "[SHORT_NAME_OF_MAIN_STACK]" then
  [OTHER LINES OF CODE]
end if

-and - 

if the owner of the target is not me then pass openStack
[OTHER LINES OF CODE]

...still cannot put text into the field by referring to it by name from
the openStack handler (again, it works in other handlers later in the
execution of the program)

However, the following worked inside of my openStack handler:

answer "The short name of field ID 1024 is: " & the short name of field
ID 1024

...as did:

put someLinesofText into field ID 1024

...however, I have my openStack handler calling another handler called
openPrefsFile and using that same:

put someLinesofText into field ID 1024

... causes the:

"Type Chunk: no such object"
"Hint 1024"

...I don't know why openStack can put text in the field when referring
by ID, but then calling another handler from openStack has a problem.

In the end, the only thing I could get to work in my readPrefsFile
handler was like this:

put lNewFilesList into field "FilesField" of cd "card id 1002" of stack
"[SHORT_NAME_OF_STACK"

So, it's a mystery to me at this point. Sorry if that was too long or
too many details.

--- Scott Morrow <scott at elementarysoftware.com> wrote:

> Perhaps the card hasn't yet opened.  You could try moving the handler
>  
> to check.
> 
> -Scott Morrow
> 
> Elementary Software
> (Now with 20% less chalk dust !)
> web     http://elementarysoftware.com/
> email   scott at elementarysoftware.com
> 
> -----------------------------------------------------------------
> 
> 
> On Feb 10, 2008, at 8:49 PM, Russell Martin wrote:
> 
> > Any idea why the following line of code errors out when run from
> > openStack, but works just fine later when called from a handler
> > responding to a button press:
> >
> > put lNewFilesField into field "FilesField"
> >
> > Is there some kind of field name initialization that hasn't
> finished  
> > by
> > the time openStack is called?
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 



      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping



More information about the Use-livecode mailing list