Home » Developer & Programmer » Forms » Variable's Scope
icon5.gif  Variable's Scope [message #137874] Sun, 18 September 2005 05:28 Go to next message
icemelid
Messages: 15
Registered: April 2005
Location: BARCELONA
Junior Member

Hello Sirs,

I've declared a variable within a trigger, whos value
I need to refer to in another trigger.

Do I need to use refer to :GLOBAL.<variable_name> ?

Thanks in advance


Re: Variable's Scope [message #137889 is a reply to message #137874] Sun, 18 September 2005 11:46 Go to previous messageGo to next message
saadatahmad
Messages: 452
Registered: March 2005
Location: Germany/Paderborn
Senior Member

hi,
yes, you need to define a global variable for this purpose.

Regards.
Re: Variable's Scope [message #137895 is a reply to message #137889] Sun, 18 September 2005 12:58 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
I tend to use package variables for that. :GLOBALs are more useful across forms. So my answer would be: "no you don't have to, but that 's one way of doing it."

MHE
Re: Variable's Scope [message #137900 is a reply to message #137895] Sun, 18 September 2005 14:07 Go to previous messageGo to next message
saadatahmad
Messages: 452
Registered: March 2005
Location: Germany/Paderborn
Senior Member

But he didn't mention that he's using a package variable.
Quote:


I've declared a variable within a trigger


This statement shows that he has defined a local variable inside a form trigger which cannot be used outside in any other trigger unless he changes this local variable to a global variable or as you suggested a variable inside a package.

Regards
Re: Variable's Scope [message #137925 is a reply to message #137900] Sun, 18 September 2005 21:41 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
He can also create a package in his form and either (I can't remember which works in which version of Forms) declare that variable in the 'spec' of the package OR declare is in the body and use functions to write and read it.

David
Previous Topic: value of an item in :SYSTEM.MOUSE_RECORD??
Next Topic: TNS: No Listener
Goto Forum:
  


Current Time: Fri Sep 20 01:51:24 CDT 2024