[server] using STACKS within ON-REV

Robert Mann rman at free.fr
Mon Aug 1 11:40:48 EDT 2011


Hi all, the former thread on the subject got bugged with other
considerations, and I'd like to share results of my tests and check it out,
so that we can have a clear picture of what we can expect from these stacks. 

This is the very simple test I made :: made a simple "teststack.livecode" in
the IDE : it contains 3 cards and 3 fields, and a few test functions.
Dropped it in a test folder on my on-rev account, and added an index.lc file
at the same level.

problems ::

1) go stack DOES NOT work

2) start using stack, seems to swallow all handlers from stackTest into the
HOME stack, so that they loose all the context of their original stack.

3) fields on cards can be accessed IF THE name of the stack is precised each
time.

So that requires to write handlers in a different way,  a standard stack
will break very easily on the server if an implicit ref. to a field is used.

Any comment? Do I get it right? does "go stack work for some?

Thanks all,
Robert

-----------
details
-----------

<html>
 <head></head>

	<body>

	<?lc

	put "<p>CGI is on with LC</p>"
	put "<p>----------------------</p>"
	-- YES : the CGI works	

	start using stack "stackTest-v1.livecode"
    -- go to stack "stackTest-v1.livecode"
	-- go stack is NOT recognized as stated in the docs
	-- http://www.runrev.com/developers/documentation/server/

    put "<p>"
    put "1 ) Simple test1 : outputing a var ="
	put "</p>"
    put test1()  -- simple function in stackTest that sends a chunk of text
back.
   	-- YES :: works fine.

	put "<p>"
    put "2) name of this stack= "
	put the name of this stack
     put "</p>"

	put "<p>"
     put "3) Number of card of this stack="
	put the number of cards of this stack 
     put "</p>"
	-- ANSWER 1 CARD, beacause the context is the "HOME" card dans not the
stackTest!

	put "<p>"
     put "3) BIS Number of card of this stack, but called from a function in
the stack stcktest.   =>  "
	put test0()
     put "</p>" 
	-- ANSWER 1 CARD, because the context is the "HOME" card dans not the
stackTest, again!
	
     put "<p>"
     put "4) Number of card of stack stacktest="
	put the number of cards of stack "stacktest" 
     put "</p>"
	-- ANSWER 3 CARD, which is right for stackTest this time.

	put "<p>"
	create card "add1"
     put "5) Number of cards of this stack after card after addition= "
     put the number of cards of this stack
	put "</p>"
	-- ANSWER 2 CARD, so we can add cards to the HOME stack.

	put "<p>"
     put "6) Field3 of card 3 of stack stacktest= "
     put field "Field3" of card 3 of stack "stacktest"
	put "</p>"
	-- YES, adressing fields works, SO LONG the name of stack is precised.
 
    put "6) BIS same query but from a function in the stack, with stackname"
	put "</p>"
    put test3()  -- simple function in stackTest that sends back the content
of a field, precizing the stakcname
	put "</p>"
-- YES, adressing fields works, SO LONG the name of stack is precised.

	 put "<p>"
    put "6) TER same query but from a function in the stack, without
stackname"
	put "</p>"
    put test2()  -- simple function in stackTest that sends back the content
of a field without the stackname
	put "</p>"
	-- NO, adressing fields works, ONLY if the name of stack is precised.
	-- CSQ :: handlers and functions have to be written specifically for the
server, with that limitation in mind.
	-- go to card 1 of this stack and put field "that field" into var DOES NOT
WORK! grr!

	-- and that is a severe error that completely blocks the process and throws
plenty of errors!!

	 ?>


	</body>
 </html>



--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/server-using-STACKS-within-ON-REV-tp3710035p3710035.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list