Script local

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Script local

Muaadh salih

In the course notes notes of  BRIGHAM YOUNG UNIVERSITY   they refer
to a "Script-local" variable in Revolution Transcript language.  This
is a very welcome advance so
  that we are not stuck between a variable that is shared  by every
handler  in the
  stack ( global) or a one that that is specific to one and only one handler.
A script -local ( as I expect it ) is shared by the script  elements
( button, field ...)
I could not find any reference to it in the dictionary or any other
documentation .
Are they correct in this ?! Any help in this matter ?!!
many thanks

--



All the best



Muaadh Salih
SOAS
Department of Near & Middle Eastern Studies
Tel . +44 (0)2078984354
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Script local

Jeanne A. E. DeVoto
At 5:24 PM +0100 7/14/2005, Muaadh salih wrote:

>In the course notes notes of  BRIGHAM YOUNG UNIVERSITY   they refer
>to a "Script-local" variable in Revolution Transcript language.
>This is a very welcome advance so
>  that we are not stuck between a variable that is shared  by every
>handler  in the
>  stack ( global) or a one that that is specific to one and only one handler.
>A script -local ( as I expect it ) is shared by the script  elements
>( button, field ...)
>I could not find any reference to it in the dictionary or any other
>documentation .
>Are they correct in this ?! Any help in this matter ?!!

Look in the dictionary for the "local" command, and also in the
encyclopedia article "Containers, variables, and sources of value"
(the "Variables" section has a subsection on script locals).
--
jeanne a. e. devoto ~ [hidden email]
http://www.jaedworks.com
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Script local

Klaus major-k
In reply to this post by Muaadh salih
Hi Muaadh,

>
> In the course notes notes of  BRIGHAM YOUNG UNIVERSITY   they refer  
> to a "Script-local" variable in Revolution Transcript language.  
> This is a very welcome advance so
>  that we are not stuck between a variable that is shared  by every  
> handler  in the
>  stack ( global) or a one that that is specific to one and only one  
> handler.
> A script -local ( as I expect it ) is shared by the script  
> elements ( button, field ...)
> I could not find any reference to it in the dictionary or any other  
> documentation .
> Are they correct in this ?! Any help in this matter ?!!

See under "local" in the docs, that's the correct term.

> many thanks
> --
> All the best

> Muaadh Salih
> SOAS
> Department of Near & Middle Eastern Studies
> Tel . +44 (0)2078984354

Regards

Klaus Major
[hidden email]
http://www.major-k.de

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Script local

Eric Chatonet
In reply to this post by Muaadh salih
Hi Muaadh,

Welcome to this list.

With Transcript, the language of Revolution, you may declare local  
and global variables: you know it :-)
But variables can be declared inside a handler or a function  
structure or outside.
When they are declared inside, it's the way you already know :-)
When a variable is declared outside any handler or function, its  
value is shared by all handlers and functions in the script where it  
has been declared. And it's very handy :-)
For instance, in the script of a button:

local allowDrag -- variable declared outside any handler
---------------------------------
on mouseDown
   put the mouseH & comma & the mouseV into allowDrag
end mouseDown
---------------------------------
on mouseMove x,y
   if allowDrag is empty then exit mouseMove
   set topLeft of this stack to globalLoc(x-item 1 of  
allowDrag&comma&y-item 2 of allowDrag)
end mouseMove
---------------------------------
on mouseUp
   put empty into allowDrag
end mouseUp
---------------------------------
on mouseRelease
     put empty into allowDrag
end mouseRelease
---------------------------------
on mouseLeave
   put empty into allowDrag
end mouseLeave

allowDrag value is valuable for all handlers.

Le 14 juil. 05 à 18:24, Muaadh salih a écrit :

> In the course notes notes of  BRIGHAM YOUNG UNIVERSITY   they refer  
> to a "Script-local" variable in Revolution Transcript language.  
> This is a very welcome advance so
>  that we are not stuck between a variable that is shared  by every  
> handler  in the
>  stack ( global) or a one that that is specific to one and only one  
> handler.
> A script -local ( as I expect it ) is shared by the script  
> elements ( button, field ...)
> I could not find any reference to it in the dictionary or any other  
> documentation .
> Are they correct in this ?! Any help in this matter ?!!
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Script local

Dar Scott
In reply to this post by Muaadh salih

On Jul 14, 2005, at 10:24 AM, Muaadh salih wrote:

> A script -local ( as I expect it ) is shared by the script  elements (
> button, field ...)
> I could not find any reference to it in the dictionary or any other
> documentation .

This is mentioned in the dictionary entry for 'local' in 2.5.1 and I
think other versions.

A script-local variable has scope everywhere in the script after the
line that declares it.  I put mine at the top of the script or at the
top of the script section where it applies.

If you put it at the top, then every handler in the script will see it,
but handlers in other scripts will not.

Dar Scott

--
**********************************************
     DSC (Dar Scott Consulting & Dar's Lab)
     http://www.swcp.com/dsc/
     Programming and software
**********************************************

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution