Down a leafy lane or up queer street?

Mike Bonner bonnmike at gmail.com
Sun Apr 29 14:29:20 EDT 2018


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 the name (IE route66)

The reason you can see the value when checking it from the message box, is
that it is executing the commands as if they were in the context of the
stack script.

To test what I mean, create a script in a button with the following:

on mouseup

put "undeclared variable:" && tUndeclared -- shows tUndeclared in the
message box

local tDeclared

put cr & "Declared but un-set variable:" && tDeclared after msg -- no value
shown, tDeclared exists but is empty

put "value set" into tDeclared

put cr & "Declared and value set to: " & tDeclared after msg -- tdeclared
exists and now has a value

end mouseup

On Sun, Apr 29, 2018 at 12:15 PM, Richmond Mathewson via use-livecode <
use-livecode at lists.runrev.com> wrote:

> 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 when it
> resides in the stackScript?
>
> 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
>> 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 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") &
>>> "/Desktop/..." unless you have created a Desktop folder inside the one
>>> holding your stack. The correct path would be
>>> specialFolderPath("resources") & "/Obfuscated/May 2018/assets/img/"
>>>
>>> --
>>> Jacqueline Landman Gay | jacque at hyperactivesw.com
>>> HyperActive Software | http://www.hyperactivesw.com
>>> On April 29, 2018 11:27:39 AM Richmond Mathewson via use-livecode <
>>> use-livecode at lists.runrev.com> wrote:
>>>
>>> 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("resources") &
>>>> "/Desktop/Obfuscated/May 2018/assets/img/" into route66 go to card
>>>> "TITLE" end preOpenStack|
>>>>
>>>> and in my cardScript I have this:
>>>>
>>>> |on preOpenCard set the lockScreen to true -------- set the filename of
>>>> img "p1" to empty ------- set the filename of img "p1" to (route66 &
>>>> "c1.png") set the blendlevel of img "p1" to 0 -------- wait 3 ticks set
>>>> the lockScreen to false end preOpenCard so, WHY cannot I see the target
>>>> image, merely a horrible grey square? Richmond. |
>>>>
>>>>
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> use-livecode at lists.runrev.com
>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>> subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>
>>
>>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list