Arev window equivalents (OpenInsight)
At 18 OCT 2001 02:37:02AM Chris Meter wrote:
What is the equivalent of the window variable REGISTER in OI.
At 18 OCT 2001 11:16AM Don Miller - C3 Inc. wrote:
There's no direct analogue to the AREV Register structure in OI. However, you can duplicate the functionality pretty easily with user-definable variables. It depends on how you want to do it.
1. On Read
Clear the @REGISTER variable: SET_PROPERTY(@WINDOW,"@REGISTER","")FORWARD_EVENTFOO=GET_PROPERTY(@WINDOW,"RECORD") ;* see if new or existingIF LEN(FOO) THENSET @REGISTER TO WHAT YOU WANT TO DO DURING UPDATEEND ELSESET @REGISTER TO WHAT YOU WANT TO DO FOR A NEW RECORDEND2. After this, you can do whatever you want to do with the @REGISTER variable
3. On WRITE
if you want @REGISTER to be cleared, determine whether before or after the write and do accordingly
if you want @REGISTER to be persistant, then don't clear it. If you want it to apply to ALL activities, then set @REGISTER on the CREATE event and clear it on the CLOSE eventHTH
Don Miller
C3 Inc.
At 19 OCT 2001 04:25AM Oystein Reigem wrote:
Chris,
To elaborate on Don's response:
As you know each window and each individual control in OI have properties associated with it. A special case is user defined properties, which you can define yourself. A user defined property is like a variable that belongs to the window or control. It exists until the window is closed. It's accessible from everywhere in your app, as long as the piece of program code that needs it knows the name of the window/control and the property.
User defined properties is a very useful concept indeed.
In OI a user defined property should have a name starting with "@", e.g "@REMEMBER".
To set a user defined property to a value, do
OldVal=Set_Property( CtrlEntId, "@REMEMBER", Value )
where CtrlEntId is the name of the window or the control. You don't have to declare a user defined property. You just start using it. In that way it's similar to a Basic+ variable.
To get the value of a user defined property, do
Value=Get_Property( CtrlEntId, "@REMEMBER" )
- Oystein -