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!

.NET

Status
Not open for further replies.

stanleyrx

Programmer
Mar 27, 2002
11
US
Anyone have sample of .net program and REXX calling each other? exchange data?
 
I refer to "OOrexx" Object Rexx , from Source Forge, which I think should interface with other .net products
 
For example, like any other command you can call from REXX PowerShell, which is .NET scripting language.
As example I take a short powershell script for CSV-processing, which I posted in this thread:
I can execute it and process the result in REXX at usual way
rexx_ps.rex
Code:
[COLOR=#0000ff]/* create command */[/color]
powershell_call [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'powershell -ExecutionPolicy RemoteSigned .\processes.ps1'[/color]
cmd [COLOR=#804040][b]=[/b][/color] powershell_call  [COLOR=#ff00ff]'| rxqueue'[/color]
[COLOR=#0000ff]/* execute command */[/color]
cmd

[COLOR=#0000ff]/* pull the powershell script results from REXX queue */[/color]
k[COLOR=#804040][b]=[/b][/color]0
[COLOR=#804040][b]do [/b][/color][COLOR=#804040][b]while[/b][/color][COLOR=#804040][b] [/b][/color][COLOR=#008080]queued()[/color] [COLOR=#804040][b]>[/b][/color] 0
  [COLOR=#804040][b]pull[/b][/color] line
  k [COLOR=#804040][b]=[/b][/color] k [COLOR=#804040][b]+[/b][/color] 1
  [COLOR=#804040][b]say[/b][/color] k[COLOR=#804040][b]||[/b][/color][COLOR=#ff00ff]'. powershell line:'[/color] line
[COLOR=#804040][b]end[/b][/color]
It works with ooREXX and Regina:
Code:
c:\Work>rexx rexx_ps.rex
1. powershell line: LOOK AT THE PROCESS 'PROC1' RUNNING ON SERVER 'SERVER1' ..
2. powershell line: LOOK AT THE PROCESS 'PROC2' RUNNING ON SERVER 'SERVER2' ..
3. powershell line: LOOK AT THE PROCESS 'PROC3' RUNNING ON SERVER 'SERVER3' ..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top