
- Rexx 教程
- Rexx - 首頁
- Rexx - 概述
- Rexx - 環境
- Rexx - 安裝
- Rexx - 外掛安裝
- Rexx - 基本語法
- Rexx - 資料型別
- Rexx - 變數
- Rexx - 運算子
- Rexx - 陣列
- Rexx - 迴圈
- Rexx - 決策
- Rexx - 數字
- Rexx - 字串
- Rexx - 函式
- Rexx - 棧
- Rexx - 檔案 I/O
- Rexx - 檔案函式
- Rexx - 子程式
- Rexx - 內建函式
- Rexx - 系統命令
- Rexx - XML
- Rexx - Regina
- Rexx - 解析
- Rexx - 訊號
- Rexx - 除錯
- Rexx - 錯誤處理
- Rexx - 面向物件
- Rexx - 可移植性
- Rexx - 擴充套件函式
- Rexx - 指令
- Rexx - 實現
- Rexx - Netrexx
- Rexx - Brexx
- Rexx - 資料庫
- 手持和嵌入式
- Rexx - 效能
- Rexx - 最佳程式設計實踐
- Rexx - 圖形使用者介面
- Rexx - Reginald
- Rexx - Web 程式設計
- Rexx 有用資源
- Rexx - 快速指南
- Rexx - 有用資源
- Rexx - 討論
Rexx - 可移植性
可移植性是任何程式語言中的一個重要方面。眾所周知,Rexx 可在各種作業系統(如 Windows 和 Linux)上使用。因此,需要確保當在 Windows 平臺上開發程式時,如果相同的程式在 Linux 平臺上執行,則已採取必要的預防措施。
Rexx 能夠執行系統級命令。有一些命令可用於瞭解其正在執行的作業系統。根據輸出,它可以採取適當的操作以檢視可以在此作業系統上執行的命令。
示例
以下示例顯示瞭如何使用 parse 函式獲取程式正在執行的作業系統的詳細資訊。
/* Main program */ parse version language level date month year. parse source system invocation filename. language = translate(language) if pos('REGINA',language) = 0 then say 'Error , the default interpreter is not Regina' language say 'The Interpreter version/release date is:' date month year say 'The Language level is: ' level say 'The Operating System is' select when system = 'WIN32' then 'ver' when system = 'UNIX' | system = 'LINUX' then 'uname -a' otherwise say 'Unknown System:' system end if rc <> 0 then say 'Error :' rc
輸出將根據作業系統而有所不同。下面給出了一個示例輸出。
The Interpreter version/release date: 5 Apr 2015 The Language level is: 5.00 The Operating System is Unknown System: WIN64 Bad return code: RC
廣告