Page 5 of 5
Re: save content of field
Posted: Sun Dec 19, 2021 2:25 pm
by Klaus
Hm, not really...
Add this line right after save... and tell us what you will read, if at all:
Code: Select all
...
save this stack
answer the result
...
Re: save content of field
Posted: Sun Dec 19, 2021 6:21 pm
by jacque
Where is the script that does the save? If it is in the splash stack then "this stack" might be the splash. Change it to
See if that works.
Re: save content of field
Posted: Sun Dec 19, 2021 10:43 pm
by Samuele
Klaus wrote: Sun Dec 19, 2021 2:25 pm
Hm, not really...
Add this line right after save... and tell us what you will read, if at all:
Code: Select all
...
save this stack
answer the result
...
the result is blank:
Re: save content of field
Posted: Sun Dec 19, 2021 10:44 pm
by Samuele
jacque wrote: Sun Dec 19, 2021 6:21 pm
Where is the script that does the save?
it's on a button that's on a card that's on the "working" stack

Re: save content of field
Posted: Mon Dec 20, 2021 12:16 am
by jacque
Samuele wrote: Sun Dec 19, 2021 10:44 pm
jacque wrote: Sun Dec 19, 2021 6:21 pm
Where is the script that does the save?
it's on a button that's on a card that's on the "working" stack
I'm having some trouble with "this stack" too in some cases. Try using the actual stack name instead of "this stack".
Re: save content of field
Posted: Mon Dec 20, 2021 1:20 am
by dunbarx
What Jacque said:
Try using the actual stack name instead of "this stack".
ALWAYS be explicit, and this applies elsewhere, as, for example in referring to controls. That way it does not matter where you are when you want to do something.
Craig
Re: save content of field
Posted: Sun Jan 02, 2022 5:40 pm
by Samuele
ok thanks to all, now it works, i think that the problem was that i forgot to delete the first script that saved without the splash stack so it put something else in the folder i called in the splash stack and so all the splash stack didn't work.

Re: save content of field [SOLVED]
Posted: Fri Jan 21, 2022 10:23 am
by Samuele
Hi, this is the script in the splash stack and it's creating me a problem on the PC because when it goes to the "working stack" it saves me a copy of the stack in the documents folder of my PC, so sometimes i make changes on that and sometimes i make changes on the original and that creates a problem because then i have 2 stacks of the same project but none of them is entirely upgraded.
Code: Select all
function isBuildingStandalone
return (the environment is "development" AND there is a stack "revStandaloneProgress" AND the mode of stack "revStandaloneProgress" > 0)
end isBuildingStandalone
on openstack
if isBuildingStandalone() then
exit openstack
end if
## Neccessary so all opened stacks can access the inclusions of stack "SPLASH"!
start using this stack
## Prepare filenames:
## Stack in RESOURCES
put specialfolderpath("resources") & "/clickMe.livecode" into tSourceStack
## Stack in DOCUMENTS folder
put specialfolderpath("documents") & "/clickMe.livecode" into tTargetStack
## check if we already opened the app = the WORKING stack is already in DOCS folder
if NOT (there is a stack tTargetStack) then
## Now copy the stack to the DOCS folder
put url("binfile:" & tSourceStack) into url("binfile:" & tTargetStack)
end if
## NOW we can open that "new" stack that NOW can be saved
go stack tTargetStack
hide stack "SplashSource"
end openstack
thanks!
Re: save content of field [SOLVED]
Posted: Fri Jan 21, 2022 10:51 am
by Klaus
... and it's creating me a problem on the PC because when it goes to the "working stack" it saves me a copy of the stack in the documents folder of my PC...
Well, that was the goal of this 5 pages long thread, wasn't it?
... so sometimes i make changes on that and sometimes i make changes on the original and that creates a problem because then i have 2 stacks of the same project but none of them is entirely upgraded...
This is definitively NOT LCs problem!
I would create the standalone only after I had made all neccessary changes to the original stack.
Re: save content of field [SOLVED]
Posted: Fri Jan 21, 2022 11:04 am
by Klaus
You could also prevent this "problem" via script:
Code: Select all
on openstack
if isBuildingStandalone() then
exit openstack
end if
## Neccessary so all opened stacks can access the inclusions of stack "SPLASH"!
start using this stack
## Prepare filenames:
## Stack in RESOURCES
put specialfolderpath("resources") & "/clickMe.livecode" into tSourceStack
## Only copy in the runtime and NOT while in the IDE:
if the environment = "development" then
go stack tTargetStack
hide stack "SplashSource"
exit openstack
end if
## This will now only be executed in a runtime!
## Stack in DOCUMENTS folder
put specialfolderpath("documents") & "/clickMe.livecode" into tTargetStack
## check if we already opened the app = the WORKING stack is already in DOCS folder
if NOT (there is a stack tTargetStack) then
## Now copy the stack to the DOCS folder
put url("binfile:" & tSourceStack) into url("binfile:" & tTargetStack)
end if
## NOW we can open that "new" stack that NOW can be saved
go stack tTargetStack
hide stack "SplashSource"
end openstack
Re: save content of field [SOLVED]
Posted: Fri Jan 21, 2022 12:38 pm
by Samuele
Thank you!
Re: save content of field [SOLVED]
Posted: Fri Jan 21, 2022 1:40 pm
by Klaus
Instead of opening your "splash" stack, you could also only open your "clickme" stack and work on it!
