Re: Down a leafy lane or up queer street?

2018-04-30 Thread Bob Sneidar via use-livecode
I avoid global variables as these are visible to any open stack you are working on, so you cannot have 2 stacks open that use the same global names or they will overwrite each other. Instead I use the custom properties of the mainstack as an ad hoc stack global system. I do this with cards and

Re: Down a leafy lane or up queer street?

2018-04-29 Thread Tore Nilsen via use-livecode
The variabel scope can be a bit tricky. The difference between a script local variabel (declared as a local variabel outside any handlers) and a global variabel can be confusing. They act very much the same way when used within one script. The main difference being that a global variabel can be

Re: Down a leafy lane or up queer street?

2018-04-29 Thread Brian Milby via use-livecode
I imagine that if you had strict mode enabled then the IDE would flag it for you too (if undeclared). On Sun, Apr 29, 2018 at 1:37 PM Richmond Mathewson via use-livecode < use-livecode@lists.runrev.com> wrote: > "it must be declared in all scripts that uses this variabel." > > Aha: *thanks* for

Re: Down a leafy lane or up queer street?

2018-04-29 Thread Richmond Mathewson via use-livecode
"it must be declared in all scripts that uses this variabel." Aha: *thanks* for that. Richmond. On 29/4/2018 9:28 pm, Tore Nilsen via use-livecode wrote: If route66 is declared as a local variabel in the card script (and it must be declared outside any handlers), then all other scripts that

Re: Down a leafy lane or up queer street?

2018-04-29 Thread Mike Bonner via use-livecode
Did you declare it as a global on the card also? You have to declare it for every context that it will be used. Stack, card, if you use it in a button script, wherever. If you've declared it in a card script, and set its value, but then use it WITHOUT declaration all you get back is the text of

Re: Down a leafy lane or up queer street?

2018-04-29 Thread Tore Nilsen via use-livecode
If route66 is declared as a local variabel in the card script (and it must be declared outside any handlers), then all other scripts that uses this variabel must reside in the card script as well. If it is declared as a global variabel, it must be declared in all scripts that uses this

Re: Down a leafy lane or up queer street?

2018-04-29 Thread Richmond Mathewson via use-livecode
OK: finally I have sorted out the problem. It seems that IFF I have this in my cardScript: globalroute66 onpreOpenCard putspecialFolderPath("resources") & "/assets/img/" intoroute66 everything works. What I would like to know is: Why does THAT script & the declaration of a global NOT work

Re: Down a leafy lane or up queer street?

2018-04-29 Thread Richmond Mathewson via use-livecode
Yet, if I do this in the Message box: put route66 I get the filepath as one would expect. Richmond. On 29/4/2018 8:56 pm, Richmond Mathewson wrote: So, I have corrected the specialFolderPath as per your instructions. But I am still going wrong as my source for the imgData of img "p1" is

Re: Down a leafy lane or up queer street?

2018-04-29 Thread Richmond Mathewson via use-livecode
So, I have corrected the specialFolderPath as per your instructions. But I am still going wrong as my source for the imgData of img "p1" is still listed asroute66p1.png . . . Richmond. On 29/4/2018 8:01 pm, J. Landman Gay via use-livecode wrote: In the IDE, specialFolderPath("resources")

Re: Down a leafy lane or up queer street?

2018-04-29 Thread Richmond Mathewson via use-livecode
Still the Queen of xTalk! Thanks. Love, Richmond. On 29/4/2018 8:01 pm, J. Landman Gay via use-livecode wrote: In the IDE, specialFolderPath("resources") points to the folder containing the working stack. In a standalone it points to the folder containing files you've included in the Copy

Re: Down a leafy lane or up queer street?

2018-04-29 Thread J. Landman Gay via use-livecode
In the IDE, specialFolderPath("resources") points to the folder containing the working stack. In a standalone it points to the folder containing files you've included in the Copy Files pane of the standalone builder. Therefore, there will never be a folder specialFolderPath("resources") &

RE: Down a leafy lane or up queer street?

2018-04-29 Thread Ralph DiMola via use-livecode
ists.runrev.com] On Behalf Of Richmond Mathewson via use-livecode Sent: Sunday, April 29, 2018 12:26 PM To: How to use LiveCode Cc: Richmond Mathewson Subject: Re: Down a leafy lane or up queer street? I am being extremely stupid, and am getting so desperate I don't mind admitting it. I have a

Re: Down a leafy lane or up queer street?

2018-04-29 Thread Richmond Mathewson via use-livecode
I am being extremely stupid, and am getting so desperate I don't mind admitting it. I have a stack containing a series of images that are 'empty' images with their sources set to an external folder. Now in my stackScript I have this: |global route66 on preOpenStack put

Re: Down a leafy lane or up queer street?

2018-04-28 Thread Richmond Mathewson via use-livecode
Thanks. Richmond. On 28/4/2018 9:11 pm, Tore Nilsen via use-livecode wrote: Ah, my bad! I always place all my script at the same level, normally the stack level. Then declaring the local variabel at the start of the script make them accessible to all handlers. You can solve this either by

Re: Down a leafy lane or up queer street?

2018-04-28 Thread Tore Nilsen via use-livecode
Ah, my bad! I always place all my script at the same level, normally the stack level. Then declaring the local variabel at the start of the script make them accessible to all handlers. You can solve this either by declaring the variabel global in all script where you will use it, or place the

Re: Down a leafy lane or up queer street?

2018-04-28 Thread Richmond Mathewson via use-livecode
No joy. What happens then is that, on looking in the properties palette for an image ("p11") having had setthefileNameofimg "p11" tosFolderPath & "c11.png" in the openCard script I see that its source is listed as sFolderPathc11.png Richmond. On 28/4/2018 8:55 pm, Tore Nilsen via

Re: Down a leafy lane or up queer street?

2018-04-28 Thread Tore Nilsen via use-livecode
What I do in these situations is to use the path stored in the variable sFolderPath like this set fileName of image “whateverImage” to sFolderPath & “imageName” or put sFolderPath & “imageName” into tFilePath set fileName of image “whateverImage” to tFilePath Tore Nilsen > 28. apr. 2018

Re: Down a leafy lane or up queer street?

2018-04-28 Thread Richmond Mathewson via use-livecode
In theory that should work . . . But what happens is that I end with a grey square rather than the actual picture. Richmond. On 28/4/2018 8:42 pm, Tore Nilsen via use-livecode wrote: Try this: local sFolderPath on preOpenStack put specialFolderPath("resources")&"/myCrap/rez/" into

Re: Down a leafy lane or up queer street?

2018-04-28 Thread Tore Nilsen via use-livecode
Try this: local sFolderPath on preOpenStack put specialFolderPath("resources")&"/myCrap/rez/" into sFolderPath end preOpenStack specialFolderPath(“resources”) will point to the folder containing the stack when you are in the IDE, and to the resources folder of your compiled application

Re: Down a leafy lane or up queer street?

2018-04-28 Thread Richmond Mathewson via use-livecode
Here I go agin, replying to my own posting: I have this script in the stack: onpreOpenStack setitemDelto"/" setthedefaultFoldertoitem 1 to-2 of(theeffectivefileNameofthis stack) endpreOpenStack but it ain't working. Richmond. On 28/4/2018 8:34 pm, Richmond Mathewson wrote: Probably both