Returning Record on a collector form (OpenInsight Specific)
At 26 JAN 1998 11:38:03AM Mark wrote:
I am attempting to extract all values from a collector form using the
follwing: Record=Get_Property(@Window, "RECORD"); This returns nothing.
However, I can return one control at a time using Get_Property("Form.ControlName","TEXT").
I need to know the command syntax to return all controls from a collector window using one command, if possible.
Thanks.
At 26 JAN 1998 01:18PM Cameron Revelation wrote:
Mark,
I need to know the command syntax to return all controls from a collector window using one command, if possible.
There are several ways to do what you are requesting. One of the handiest features of properties is the ability to get and set en masse. As an example:
<code> subroutine End_Collector(void) declare subroutine End_Dialog Ctrls=Get_Property(@window, "CTRLMAP") convert @fm to @rm in Ctrls Vals=Get_Property(Ctrls, "DEFPROP") convert @rm to @vm in Ctrls convert @rm:@fm:@vm to @vm:@svm:@tm in Vals List=Ctrls: @fm: Vals End_Dialog(@window, List)</code>
Execute the above subroutine to close the collector dialog, for example, on the "OK" button.
The code to extract a value from the list of values returned is simple:
<code> function Extract_Field(List, Ctrl) locate Ctrl in List using @vm setting Pos then Val=List convert @svm:@tm to @fm:@vm in Val return Val end else return "" end</code>
The dialog callee would have code like:
<code> * call the login dialog which has controls NAME and PASSWORD Ret =Dialog_Box("LOGIN_DIALOG", @window) Name=Extract_Field(Ret, "NAME") Pwd =Extract_Field(Ret, "PASSWORD")</code>
Cameron Purdy
info@revelation.com