Calling OpenInsight from within Arev32 (Functions/Subroutines/Programs,General)
Created at 22 OCT 2012 03:13PM
This is a sample of calling an OpenInsight function from AREV32 sending and returning data.
This sample will tell OpenInsight to print a report and return the result 'REPORT OK'.
AREV32 Program Test1
DECLARE FUNCTION CTO_GUI_FUNCTION
!CALL OI SUBROUTINE SENDING REPORT NAME
RESULTS = CTO_GUI_FUNCTION('TEST2','TESTRPT')
CALL MSG(RESULTS)
OI Test1 Program
FUNCTION TEST2(REPORT)
Call Run_Report(REPORT,'')
RESULTS = 'REPORT OK'
RETURN RESULTS
The sample code below shows how to run a dialog box in OpenInsight from AREV32 sharing data.
This sample will run a dialog box in OpenInsight sending in a control number to display and return the name and address entered in the dialog box.
AREV32 Program TEST
DECLARE FUNCTION CTO_DIALOG_BOX
!CALL OI DIALOG BOX SENDING CONTOL NUMBER 12345 AS CREATEPARAM
RESULTS = CTO_DIALOG_BOX('TEST',12345)
! DISPLAY RESULT OF DIALOG BOX
CALL MSG(RESULTS)
Create Event of TEST window in OpenInsight.
control = createparam
call set_property(@window:'.CONTROL','DEFPROP',CONTROL)
RETURN 0
Save Event of TEST window in OpenInsight.
RESULT = GET_PROPERTY(@WINDOW:'.NAME','DEFPROP')
RESULT: = @FM: GET_PROPERTY(@WINDOW:'.ADDRESS','DEFPROP')
CALL END_DIALOG(@WINDOW,RESULT)
RETURN 0