home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
vxdemo.zip
/
SYSTEM.$$$
/
RF3PARM.VRM
< prev
next >
Wrap
Text File
|
1993-09-16
|
5KB
|
219 lines
/* Custom mainline for macro */
call RXFuncAdd "VRLoadFuncs", "VROBJ", "VRLoadFuncs"
call VRLoadFuncs
_VREVersion = SubWord( VRVersion( "VRObj" ), 1, 1 )
if( _VREVersion < 1.01 )then do
call VRMessage "", "This program requires VX-REXX version 1.01 to run", "Error!"
_VREReturnValue = 32000
signal _VRELeaveMain
end
signal on SYNTAX name _VRESyntax
signal _VREMain
_VRESyntax:
parse source . . _VRESourceSpec
call VRMessage "", "Syntax error in" _VRESourceSpec "line" SIGL, "Error!"
_VREReturnValue = 32000
signal _VRELeaveMain
_VREMain:
/*:VRX Main
*/
/* Main
*/
Main:
/* Process the arguments.
Get the parent window.
*/
parse source . calledAs .
parent = ""
argCount = arg()
argOff = 0
if( calledAs \= "COMMAND" )then do
if argCount >= 1 then do
parent = arg(1)
argCount = argCount - 1
argOff = 1
end
end
InitArgs.0 = argCount
if( argCount > 0 )then do i = 1 to argCount
InitArgs.i = arg( i + argOff )
end
drop calledAs argCount argOff
/* Load the windows
*/
call VRInit
parse source . . spec
_VREPrimaryWindowPath = ,
VRParseFileName( spec, "dpn" ) || ".VRW"
_VREPrimaryWindow = ,
VRLoad( parent, _VREPrimaryWindowPath )
drop parent spec
if( _VREPrimaryWindow == "" )then do
call VRMessage "", "Cannot load window:" VRError(), ,
"Error!"
_VREReturnValue = 32000
signal _VRELeaveMain
end
/* Process events
*/
call Init
signal on halt
do while( \ VRGet( _VREPrimaryWindow, "Shutdown" ) )
_VREEvent = VREvent()
interpret _VREEvent
end
_VREHalt:
_VREReturnValue = Fini()
call VRDestroy _VREPrimaryWindow
_VRELeaveMain:
call VRFini
exit _VREReturnValue
VRLoadSecondary: procedure
name = arg( 1 )
window = VRLoad( VRWindow(), VRWindowPath(), name )
call VRMethod window, "CenterWindow"
call VRSet window, "Visible", 1
call VRMethod window, "Activate"
return window
/*:VRX Comments
*/
Comments:
/*
RF3Parm: Generate a prototype for 3 parameter REXX functions
Usage: call RF3Parm <Parent>, <Function>
Where: Parent is the parent window for the dialog
Function is the function that is using this macro.
*/
return
/*:VRX Error
*/
Error: procedure
field = arg( 1 )
error = arg( 2 )
call VRMessage VRWindow(), error, "Error"
call VRMethod field, "SetFocus"
return
/*:VRX Fini
*/
Fini:
window = VRWindow()
call VRSet window, "Visible", 0
drop window
return Prototype
/*:VRX Halt
*/
Halt:
signal _VREHalt
return
/*:VRX Init
*/
Init:
Prototype = ""
TargetObject = InitArgs.1
argument = InitArgs.2
parse var argument Funcname "_" Retval "_" v1 "_" v2 "_" v3
call VRSet "Window1", "Caption", funcname
call VRSet "PB_3", "HintText", "Help for the" funcname "function."
call VRSet "DT_1", "Caption", v1 || ":"
call VRSet "Value1", "HintText", "Set the" v1 "parameter."
call VRSet "Quotes1", "HintText", "Uncheck this if" v1 "is a variable."
call VRSet "DT_2", "Caption", v2 || ":"
call VRSet "Value2", "HintText", "Set the" v2 "parameter."
call VRSet "Quotes2", "HintText", "Uncheck this if" v2 "is a variable."
call VRSet "DT_3", "Caption", v3 || ":"
call VRSet "Value3", "HintText", "Set the" v3 "parameter."
call VRSet "Quotes3", "HintText", "Uncheck this if" v3 "is a variable."
window = VRWindow()
call VRMethod window, "CenterWindow"
call VRSet window, "Visible", 1
call VRMethod window, "Activate"
drop window
return
/*:VRX PB_1_Click
*/
PB_1_Click:
value1 = VRGet( "Value1", "Value" )
quotes1 = VRGet( "Quotes1", "Set" )
if quotes1 = 1 then do
value1 = '"' || value1 || '"'
end
value2 = VRGet( "Value2", "Value" )
quotes2 = VRGet( "Quotes2", "Set" )
if quotes2 = 1 then do
value2 = '"' || value2 || '"'
end
if value2 \= "" then do
value2 = ", " || value2
end
value3 = VRGet( "Value3", "Value" )
quotes3 = VRGet( "Quotes3", "Set" )
if quotes3 = 1 then do
value3 = '"' || value3 || '"'
end
if value3 \= "" then do
value3 = ", " || value3
end
Prototype = Retval ' = ' || Funcname ||,
'( ' || value1 ||,
value2 ||,
value3 || ' )'
call Quit
return
/*:VRX PB_2_Click
*/
PB_2_Click:
rc = ""
call Quit
return
/*:VRX PB_3_Click
*/
PB_3_Click:
"view rexx.inf" funcname
return
/*:VRX Quit
*/
Quit:
window = VRWindow()
call VRSet window, "Shutdown", 1
drop window
return
/*:VRX Window1_Close
*/
Window1_Close:
rc = ""
call Quit
return