2 questions

Klaus Major klaus at major-k.de
Mon Feb 28 12:09:31 CST 2005


Hi Rob,

> Frank and everybody
> Thank you very much. I have read the topics, but being a recrute on 
> the revolutionary field,
> it still is too difficult fior me. Moreover RevDoc has a lack of good 
> and practical examples,
> so I have to find my way with trial and error.
>
> Nevertheless I have 2 questions.
> I builded a stack and a substack. The substack "frontpage" is larger 
> than the mainstack:
> I call the stack that opens "the mainstack". Right? The mainstack is 
> called "pages".
> On the frontpage there is a field "content", registering the name of 
> each page, everytime
> the frontpage is entered.The "frontpage" has a larger size than the 
> cards in "pages".
>
> To execute the registering of the pages, there is a handler called 
> "fillfield" in the stackscript.
> Because this handler has to become active when entering the frontpage, 
> I put "send fillfield"
> in the cardscript of "frontpage" with on opencard:
> This handler does not react when entering the Frontpage.
>
> The only way to get the handler active is to put "send fillfield" in a 
> navigationbutton of the
> pages.

You have a handler in the stack script of stack "frontpage" called 
"fillfield" and want it to be executed
everytime a card is opened?

In that case put this into the stack script, too:

on opencard
   ## or preopencard
   fillfield
   ## no need to SEND anything!
end opencard

> How to call a handler in a substack?
>
> Question 2.
> In the stackscript I wrote:
> function content
>   return "field" &&quote&content&quote&& "of stack" 
> &&quote&frontpage&quote
> end content
> returning: field "content" of stack "frontpage"

Yeah, this will return this STRING:  field "content" of stack 
"frontpage"!

No quotes needed:

function content
   return fld "content" of CD X of stack "frontpage"
end content

Please note the exact identifier "...of CARD xxx of stack..." might be 
necessary,
if the object is not on the CURRENT card of that stack!

> The number of lines in field  "content" = 89
> but: put the number of lines of content()  puts 1
> but: put the number of lines of field "content" of stack "frontpage"   
> puts 89
>
> What did I do wrong with the function function.

See above, too much quotes :-)


To call a function of another stack do this:
...
put value("name_of_function()",stack "frontpage") into myVar
...

...value("name of function(params...)", exact description where the 
function resides)

Hope that helps.

> Thanks
> Rob
>
> robmeyer at hetnet.nl
> www.japrosoft.com
> no more spam: Mailwasher Pro
> http://www.firetrust.com/products/pro/
> and please mention my emailaddress...

Regards

Klaus Major
klaus at major-k.de
http://www.major-k.de



More information about the use-livecode mailing list