Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

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_EVENT
  FOO=GET_PROPERTY(@WINDOW,"RECORD") ;* see if new or existing
  IF LEN(FOO) THEN
    SET @REGISTER TO WHAT YOU WANT TO DO DURING UPDATE
  END ELSE
    SET @REGISTER TO WHAT YOU WANT TO DO FOR A NEW RECORD
  END

2. 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 event

HTH

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 -


At 23 OCT 2001 07:42AM Dave Harmacek (Harmacek Database Systems) wrote:

  • third_party_content/community/commentary/forums_works/155b02064274806f85256ae90024599e.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1