SubStack messes up put statement
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 738
- Joined: Thu Sep 11, 2014 1:49 pm
SubStack messes up put statement
Good afternoon LC friends,
I have the following issue and it probably has to do with message paths but I cannot see a solution.
I have a substack with a spinner on it that I want to open from a card (in 'On openCard') and show on top before I start a command and close after the command is finished. The command resides in the main stack and has a put command that puts information into a field on the Card I called the command from. I do not have to add the card name to the put command because the message path recognizes that the command has been called from the card on which the field resides. This works fine until I open the substack before I call the command and then the command cannot find the field anymore to put the data in.
Is there any solution for this?
Regards,
Paul
I have the following issue and it probably has to do with message paths but I cannot see a solution.
I have a substack with a spinner on it that I want to open from a card (in 'On openCard') and show on top before I start a command and close after the command is finished. The command resides in the main stack and has a put command that puts information into a field on the Card I called the command from. I do not have to add the card name to the put command because the message path recognizes that the command has been called from the card on which the field resides. This works fine until I open the substack before I call the command and then the command cannot find the field anymore to put the data in.
Is there any solution for this?
Regards,
Paul
Re: SubStack messes up put statement
Dag Paul,
what did you script so far?
Best
Klaus
what did you script so far?
Best
Klaus
-
- Posts: 738
- Joined: Thu Sep 11, 2014 1:49 pm
Re: SubStack messes up put statement
Hoi Klaus,
This is the structure of the code I use for starting and stopping the widget spinner which is on a substack called "WaitSpinner".
So in a card "JustACardName" with a field named "FieldnameOnCard" I use the code
The StartSpinner, StopSpinner and DoWhatINeedToDo commands ared in the main stack.
That basically it.
Of course the actual code is not this but this is the structure (working on an AI trading Bot so I need to show the spinner while the bot is retrieving data from the internet or when a lot of calculations need to be made that take a little while).
This is the structure of the code I use for starting and stopping the widget spinner which is on a substack called "WaitSpinner".
So in a card "JustACardName" with a field named "FieldnameOnCard" I use the code
Code: Select all
StartSpinner
DoWhatINeedToDo
StopSpinner
Code: Select all
command StartSpinner
## Use SCREEN coordinates directly!
put globalloc(the topLeft of stack "TradeBot_Tests") into tsavedTopLeft
## Add H and V offset
add 180 to item 1 of tsavedTopLeft
add 100 to item 2 of tsavedTopLeft
open stack "WaitSpinner"
set the topLeft of stack "WaitSpinner" to tsavedTopLeft
end StartSpinner
command StopSpinner
close stack "WaitSpinner"
end StopSpinner
command DoWhatINeedToDo
put "This text I need to show" into fld "FieldnameOnCard"
end DoWhatINeedToDo
Of course the actual code is not this but this is the structure (working on an AI trading Bot so I need to show the spinner while the bot is retrieving data from the internet or when a lot of calculations need to be made that take a little while).
Re: SubStack messes up put statement
Hi Paul,
hm, maybe one of these will help:
Or:
Will also work if the substack is not open. 
Hint:
You can set the loc, rect etc. of a stack BEFORE you open it, so any flickering will be avoided.
Hope that help!
Best
Klaus
hm, maybe one of these will help:
Code: Select all
command DoWhatINeedToDo
put "This text I need to show" into fld "FieldnameOnCard" OF CD X OF stack "the one with the field you want to put something in"
end DoWhatINeedToDo
Code: Select all
command DoWhatINeedToDo
set the defaultstack to "the one with the field you want to put something in"
put "This text I need to show" into fld "FieldnameOnCard"
end DoWhatINeedToDo

Hint:
You can set the loc, rect etc. of a stack BEFORE you open it, so any flickering will be avoided.
Code: Select all
command StartSpinner
...
## First set properties:
set the topLeft of stack "WaitSpinner" to tsavedTopLeft
## Then go to stack without flicker:
open stack "WaitSpinner"
end StartSpinner
Best
Klaus
-
- Posts: 738
- Joined: Thu Sep 11, 2014 1:49 pm
Re: SubStack messes up put statement
Bedankt Klaus,
I have placed the 'set the defaultstack to' line as the last line in the 'StartSpinner' command as well as the last line in the 'StopSpinner' command (to be sure) and I now have no problems anymore.
Thanks for your valuable help ( ... again ...)
PS.. Do you know a trick that removes the borderline of the substack or makes it only showing the spinner?
I have placed the 'set the defaultstack to' line as the last line in the 'StartSpinner' command as well as the last line in the 'StopSpinner' command (to be sure) and I now have no problems anymore.
Thanks for your valuable help ( ... again ...)

PS.. Do you know a trick that removes the borderline of the substack or makes it only showing the spinner?
Re: SubStack messes up put statement
Graag gedaan! 
with these images while setting the windowshape.

You could use a WINDOWSHAPE and even animate it, but therefore you will need some PNGs images and "fake" the SPINNERPS.: Do you know a trick that removes the borderline of the substack or makes it only showing the spinner?
with these images while setting the windowshape.
-
- Posts: 738
- Joined: Thu Sep 11, 2014 1:49 pm
Re: SubStack messes up put statement
Placed the following in the preOpenStack part of the WaitSpinner stack and I got what I was looking for.
Code: Select all
on preopenstack
set the windowShape of this stack to the id of widget "Spinner"
set the style of this stack to palette
set the blendLevel of this stack to 40
end preopenstack
Re: SubStack messes up put statement
REALLY?
I just tested this here and did not get what I exspected!
As far as I know WINDOWSHAPE only works with images!?

I just tested this here and did not get what I exspected!
As far as I know WINDOWSHAPE only works with images!?
Re: SubStack messes up put statement
Why not just show the spinner on the card in the mainstack?
You don't say whether this will be for desktop or mobile, but be aware you can't have two stacks open simultaneously on mobile.
You don't say whether this will be for desktop or mobile, but be aware you can't have two stacks open simultaneously on mobile.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 738
- Joined: Thu Sep 11, 2014 1:49 pm
Re: SubStack messes up put statement
Hi Jaque
Regards,
Paul
True, I could just show the spinner on the card. But this way I can use the same routine on the other cards very easy. And it was for learning purposes.Why not just show the spinner on the card in the main stack?
I am working on an application that will probably only be run on Windows and might run on Linux. So not on a mobile platform. Thanks for the warning. It is something I did not know.be aware you can't have two stacks open simultaneously on mobile
Regards,
Paul
-
- Posts: 738
- Joined: Thu Sep 11, 2014 1:49 pm
Re: SubStack messes up put statement
My method is to group the temporary control(s). When I want to display it, place the group on the card. When I'm done with it, remove the group from the card. This is very fast and uses less resources, and allows the use of the group anywhere.
Groups do not have to be placed on any card, they can exist without any visible presence.
Groups do not have to be placed on any card, they can exist without any visible presence.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 738
- Joined: Thu Sep 11, 2014 1:49 pm
Re: SubStack messes up put statement
Thanks for the
tip Jacque
