Page 1 of 1

standalone not same as editor

Posted: Mon Sep 16, 2013 11:49 am
by pascalh4
Hi

Following my tests on stack, another issue concerns me.

when I start the command of a stack, which created another, I no problems in the editor LiveCode. (Use of the first stack displays the second stack)

But when I make an executable, the second stack is not displayed.

Is there a particular décalration to do this?

Pascal

Re: standalone not same as editor

Posted: Mon Sep 16, 2013 12:09 pm
by Klaus
Which commands do not work in a standalone?

Re: standalone not same as editor

Posted: Mon Sep 16, 2013 1:10 pm
by pascalh4
hi Klaus

here is the code that does not work.
In the editor a new F0 stack is displayed and not the standalone.

Code: Select all

on mouseUp
   put 00 into tNum 
   ask "donner un titre" 
   if it=empty then exit to top 
   put it into Nvar
   
   set the name of stack "F0base" of stack "Outils de création" to ( "F" & tNum  & "  " &  Nvar) 
   hide stack ( "F" & tNum  & "  " &  Nvar) 
   set the loc of stack  ( "F" & tNum  & "  " &  Nvar)  to 450,300
   
   
   clone stack( "F" & tNum  & "  " &  Nvar) of stack"Outils de création" 
   put 0 into tNum 
   set the name of stack ( "copy of F00"  & "  " &  Nvar) to ( "F" & tNum  & "  " &  Nvar) 
   set the loc of stack ( "F" & tNum  & "  " &  Nvar) to 650,350  
   
   hide button "Nouveau Tutoriel" 
   go to stack"Outils de création"
end mouseUp
I've made ​​a mistake?

Pascal

Re: standalone not same as editor

Posted: Mon Sep 16, 2013 2:26 pm
by Klaus
Hi Pascal,

the script is OK, and when it does work in the IDE it also should work in the standalone!
Since I have no idea what is going on, you could add a ANSWER here and ther, so you can
at least see WHAT command is NOT being executed in your standalone:

Code: Select all

on mouseUp
   put 00 into tNum 
   ask "donner un titre" 
   if it=empty then exit to top 
   put it into Nvar
   answer "user title:" && Nvar
   
   set the name of stack "F0base" of stack "Outils de création" to ( "F" & tNum  & "  " &  Nvar) 
   answer "Set stack name OK"

   hide stack ( "F" & tNum  & "  " &  Nvar) 
   set the loc of stack  ( "F" & tNum  & "  " &  Nvar)  to 450,300
   answer "Set stack visible and LOC OK"
   
   clone stack( "F" & tNum  & "  " &  Nvar) of stack"Outils de création" 
   answer "clone stack OK"

   put 0 into tNum 
   set the name of stack ( "copy of F00"  & "  " &  Nvar) to ( "F" & tNum  & "  " &  Nvar) 
   answer "Set stack name of clone OK"

   set the loc of stack ( "F" & tNum  & "  " &  Nvar) to 650,350  
   
   hide button "Nouveau Tutoriel" 
   go to stack"Outils de création"
end mouseUp
Know what I mean? This way you will see which dialog does NOT appear and might get a hint...


Best

Klaus

Re: standalone not same as editor

Posted: Mon Sep 16, 2013 3:08 pm
by pascalh4
Hi Klaus

Ok, I'll make "ANSWER" test
AndI come back if I find the reason.

Pascal

Re: standalone not same as editor

Posted: Mon Sep 16, 2013 4:36 pm
by pascalh4
Hi Klaus

I found, but it seems illogical.
In the second part of code, I use "hide"
everything works with this code in the editor but not in standalone.

Code: Select all

   hide button "Nouvelle Fiche"
   show button "Sauver la fiche"
   
   hide stack ( "F" & tNum  & "  " &  Nvar)
   clone stack ( "F" & tNum  & "  " &  Nvar)
   
   set the mainstack of it to  the mainstack of stack "Outils de création"
   add 1 to tNum
   set the name of it to ( "F" & tNum  & "  " &  Nvar)
   set the loc of stack ( "F" & tNum  & "  " &  Nvar) to (650,350)
   go to "Outils de création"



but with adding " show stack ( "F" & tNum & " " & Nvar)" then the standalone works

Code: Select all

   hide button "Nouvelle Fiche"
   show button "Sauver la fiche"
   
   hide stack ( "F" & tNum  & "  " &  Nvar)
   clone stack ( "F" & tNum  & "  " &  Nvar)
   
   set the mainstack of it to  the mainstack of stack "Outils de création"
   add 1 to tNum
   set the name of it to ( "F" & tNum  & "  " &  Nvar)
   show stack ( "F" & tNum  & "  " &  Nvar)
   set the loc of stack ( "F" & tNum  & "  " &  Nvar) to (650,350)
   go to "Outils de création"
Is there a reason for this (why the "show" command is not necessary in the editor)?

Pascal

Re: standalone not same as editor

Posted: Tue Sep 17, 2013 10:46 am
by Klaus
Hi Pascal,

sorry, no idea.

But again, do not put parens around the numbers for a LOC or RECT:
...
## BAD: set the loc of XYZ to (650,350)
Good: set the loc of XYZ to 650,350
...


Best

Klaus

Re: standalone not same as editor

Posted: Tue Sep 17, 2013 7:45 pm
by pascalh4
Hi Klaus,
sorry, no idea.
It doesn't matter, since a solution is found.
## BAD: set the loc of XYZ to (650,350)
Good: set the loc of XYZ to 650,350
For the parentheses, it was just forgetting of my previous error.

Thank's for all

Pascal