I am running both Arev and OI32 to access the same data.
There is a field that contains the value "Y" or "N" in Arev. However, in OI forms, I would like to convert this field to a check box and write back the result to "Y" or "N"
In the READ event, i wrote:
if {PREMI} EQ "Y" THEN
set_property(win_name : ".PREMI","CHECK",1)END ELSE
set_property(win_name : ".PREMI",0)END
The above works well. But during the WRITE event, I want to change the value back to "Y" or "N" (i don't want to save it as 1 or 0)
So i have the following script at WRITE event:
CHECK_STATUS=GET_PROPERTY(WIN_NAME : ".PREMI","CHECK")
OPEN "DICT.EMPLOYEE_DB" TO @DICT ELSE NULL
IF CHECK_STATUS=1 THEN
{PREMI}=Y"END ELSE
{PREMI}=N"END
FORWARD_EVENT()
RETURN 0
But it always write back as 1 or 0. I tried changing the @record but it still writes back as 1 or 0 (instead of Y or N).
What should I do ?
Rudhy
{} is pure RHS and cannot be used LHS, so={} is allowed but {}=is not.
The simplest solution we can see is to add a hidden field containing the data (Y or N) and a non data linked check box. At the pre-save if the check box is true set the data aware control to Y, if false N.
You could also create your own "yes/no" ICONV/OCONV conversion proceedure. That way it would automatically do it for you at read and write time.
Check out the "ZIP_FORMAT" row (record), in the "SYSPROCS" table (file).
I use this method for comboboxes, checkboxes, and radio buttons. Works great.
Yeap, that works :)
BTW, I love your CPUPlus and SList 32.
Rudhy
Very glad to hear it (and thanks ). Richard's answer is actually better but figured ease of use would triumph over programming effort…
Sorry we missed you on way to Oz - can we catch you on way back? - Francesca has Singapore on her "must visit list".
I'll figure out Richard's way. But since I'm a OI novice i'll use ur solution for now:)
Francesca should stop over in Singapore (the cleanest city on earth :)
I'm in HongKong on the way to Manila. I'll be at the Las Vegas conference. I'll stop by introduce myself. I'm looking for tools to make it easier for us to convert our Arev app to OI.
Rudhy
We do have tools to assist the process, as do other developers who hang around here! Look forward to seeing you at Vegas.