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 o
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
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 th
"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 u
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
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 variabel.
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 w
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
sti
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") points
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 Fil
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") &
"/De
ecode-boun...@lists.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
admitt
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 specialFolderPath("res
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 de
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 s
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 use-liv
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 kl.
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 sFolder
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
To
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
Probably both . . .
So, there I am opening an on-going project I have been "somewhat remiss"
about of late
what with one thing and another.
Now this project has a ton of images made via the Object/New
Control/Image menu
and for their image data in their property panels are referred to a
fold
21 matches
Mail list logo