Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

REXX & VB 1

Status
Not open for further replies.

REXX4QA

Programmer
Oct 12, 2011
4
US
How can i receive arguments from a VB script in REXX?
 
It's possible with ooREXX (Open Object REXX) which could be integrated with WSH (Windows Script Host).
You can combine VBscript and ooREXX functions in one script:

Rexx_VBscript.wsf
Code:
[COLOR=#008080]<[/color][COLOR=#008080]job[/color][COLOR=#008080] [/color][COLOR=#2e8b57][b]id[/b][/color]=[COLOR=#ff00ff]"REXX_VBscript"[/color][COLOR=#008080]>[/color]

[COLOR=#008080]<script language="VBScript">[/color]
[COLOR=#804040][b]function[/b][/color] add_two[COLOR=#804040][b]([/b][/color]x[COLOR=#804040][b],[/b][/color] y[COLOR=#804040][b])[/b][/color] 
  add_two [COLOR=#804040][b]=[/b][/color] x [COLOR=#804040][b]+[/b][/color] y
[COLOR=#804040][b]end[/b][/color] [COLOR=#804040][b]function[/b][/color]
[COLOR=#008080]</script>[/color]

[COLOR=#008080]<[/color][COLOR=#008080]script[/color][COLOR=#008080] [/color][COLOR=#2e8b57][b]language[/b][/color]=[COLOR=#ff00ff]"Object Rexx"[/color][COLOR=#008080]>[/color]
/*---------- Calling VBscript from REXX --------------------*/
/*** Main program ***/
say "Enter variables to add:"
x = raw_input("x = ")
y = raw_input("y = ")

z = add_two(x, y)
say x "+" y "=" z
exit

/**************** Functions ****************/
raw_input: procedure
/* function raw_input() */
  use arg prompt
  call charout , prompt
  parse pull inp
  return inp
[COLOR=#008080]</script>[/color]
[COLOR=#008080]</job>[/color]
Output:
Code:
c:\Users\Roman\Work>cscript /NoLogo Rexx_VBscript.wsf
Enter variables to add:
x = 5
y = 15
5 + 15 = 20

Some time ago I posted other example here:

But when you want to use the WSH functionality from ooREXX, be aware of the ooREXX version:
WSH support was disabled in ooREXX version 4.0.0 and 4.0.1.
I was disappointed and therefore still using older version 3.2.0.
I don't know how it's with WSH support in the newest version 4.1.0, because I never tried it.
 
Thanks Mikrom. Actually, I want to build a VB form to to input some parameters and then transfer them to MVS/CMS where my REXX program will receive those parameters as a arguments and then start processing based on that.

Can you let me know how to do that?
 
First I thought that you want to run Vbscript + REXX together on windows. Now it seems that you want to write CGI scripts in REXX.
I haven't experience with this. Try to google for CGI mainframe REXX
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top