Call Unix Script from PeopleCode
2008-08-07 12:29
399 查看
A function to call UNIX and/or shell script from PeopleCode.
/*call unix script from PeopleCode*/
Function CallScript;
/*According to PeopleBooks, PS_HOME is always prefixed to the file location*/
&exitCode = Exec("/path/to/script/scriptname ", True);
End-Function;
The Exec command has changed in PT8.4x so the above function will be:
Function CallScript;
/*Use %Exec_Asynchronous if it is not important to wait for a response from the called script*/
&exitCode = Exec(&PS_HOME | "path/to/script/scriptname", %Exec_Synchronous + %FilePath_Absolute);
If &exitCode <> 0 Then
MessageBox(0, "", 0, 0, ("Script was not Successful! Exit code returned by script was " | &exitCode));
End-If;
End-Function;
If you are using the Exec call inside of an Application Engine and you are calling it in a Synchronous mode, make sure you commit your work before you call it, otherwise, you will get a run time error.
CommitWork();
CallScript();
/*call unix script from PeopleCode*/
Function CallScript;
/*According to PeopleBooks, PS_HOME is always prefixed to the file location*/
&exitCode = Exec("/path/to/script/scriptname ", True);
End-Function;
The Exec command has changed in PT8.4x so the above function will be:
Function CallScript;
/*Use %Exec_Asynchronous if it is not important to wait for a response from the called script*/
&exitCode = Exec(&PS_HOME | "path/to/script/scriptname", %Exec_Synchronous + %FilePath_Absolute);
If &exitCode <> 0 Then
MessageBox(0, "", 0, 0, ("Script was not Successful! Exit code returned by script was " | &exitCode));
End-If;
End-Function;
If you are using the Exec call inside of an Application Engine and you are calling it in a Synchronous mode, make sure you commit your work before you call it, otherwise, you will get a run time error.
CommitWork();
CallScript();
相关文章推荐
- Quick way to send emails from PeopleCode
- Calling code/script from a Rule
- Call C# code from C++
- Call Exec in PeopleCode
- How to call Delphi code from scripts running in a TWebBrowser
- How to call a android/native service from a native/android (java) code
- 解决:The virtual machine was unable to remove all stack frame runnning old code from the call stack.问题
- Extract PeopleCode from the Database
- Call C# Code from C++ and read an array of struct which contains strings
- call a JavaScript function from C++ code
- calling into the CLR from managed code via QCall and FCall methods
- 通过WebBrowser中的脚本调用Delphi自定义的方法(How to call Delphi code from scripts running in a TWebBrowser)
- Generate Excel Spreadsheet from PeopleCode
- Qt 5.4/Android: Call Qt method from Java code
- How to hide & unhide the grid from the page by using people code?
- A Mainframe IDE Powered By Unix Technology [11] - Submit JCL from ftp command or shell script
- Trigger script exited with code: 1 From https://github.com/CocoaPods/Specs 9967bbf..de7b3da master -
- Considerations when calling Java from PeopleCode
- Calling an Application Engine from PeopleCode
- Hide a Grid Column From a Grid in PeopleCode