Hi Pascal,
what Björnke means, is that you are missing the most basic things of Livecde
but they are very neccessary to be able to use Livecode!
if name of stack into this stack begins with "S" then
Do not use any syntax if you are not sure what it does, or if it even exists!
Check these stacks to get the basics about stacks, substacks, cards, objects etc...:
Code: Select all
http://www.hyperactivesw.com/revscriptconf/scriptingconferences.html
Please do in you own interest!
OK, I will explain the "real life" analogy from my first posting here:
1. The list of stacks is MANDATORY as I wrote, and I guess you mean the SUBSTACKS** of your mainstack, right?
** C'est le mot magique ici!
The you can:
...
put the substacks of stack"Base" into tSubStackList
## Now you have a CR delimited list of all the substacks of your mainstack (Base) in the variable
...
2. See which of these lines start with an L or whatever character:
...
put "L" into tFirstCharacter
## You can use LINEOFFSET or FILTER
## I use FILTER here, which will remove ALL lines that do NOT begin with that character
filter tSubStackList with (tFirstCharacter & "*")
## If you have prepared everything correctly (NOT 2 substacks with the same first character in name etc...) you can now:
go stack tSubStackList
## the list should only contain ONE line -> the name of the substack that begins with L
...
3. Now all together for your button script:
Code: Select all
on mouseup
put the substacks of stack"Base" into tSubStackList
put "L" into tFirstCharacter
filter tSubStackList with ("*" & tFirstCharacter)
## Better check once to much thatn getting an error!
if tSubStackList = empty then
exit mouseup
end if
## Finally go to the stack:
go stack tSubStackList
end mouseup
See how the logical principles of "real life" can be "tranlsated" into Livecode easily?
But you need to analyze and understand them first AND to underatand the language
of Livecode to be able to tranlate them at all!!
If you do not know the word for that round leather thing that you can kick with your foot,
then you cannot translate it into another language
Try to digest and UNDERSTAND what I am doing here.
After you "got" it, we will create a FUNCTION for this,
where you only need to supply the first desired chracter.
But not now!
Best
Klaus