📄 sample1.cmd
字号:
/*****************************************************************************//* Software Testing Automation Framework (STAF) *//* (C) Copyright IBM Corp. 2001 *//* *//* This software is licensed under the Common Public License (CPL) V1.0. *//*****************************************************************************//*********************************************************************//* Sample1.cmd - Rexx sample program using STAF *//*********************************************************************//* This sample loads the STAF Functions, registers to STAF, queries *//* a global variable from STAF, inititates a synchronous process *//* which is a chkdsk of the boot drive, then unregisters. *//* *//* Returns: 0, on success *//* >0, if an error is encountered *//*********************************************************************//* Date Who Comment *//* ---------- ------------ --------------------------------------- *//* 02/01/1998 D. Randall File Created *//*********************************************************************/SIGNAL ON HALT NAME STAFAbort/* Load STAF functions */call RxFuncAdd "STAFLoadFuncs", "RXSTAF", "STAFLoadFuncs"call STAFLoadFuncs/* Register to STAF */call STAFRegister "STAF_REXX_Sample1"if RESULT \= 0 thendo say "Error registering to STAF:" RESULT RETURN RESULTend/* Query STAF for a variable */STAFRC = STAFSubmit("local", "var", "resolve {STAF/Config/BootDrive}")if STAFRC = 0 then bootdrive = STAFResultelsedo say "Unable to determine boot drive!" call STAFUnRegister RETURN STAFRCend/* Build the process start request with a work load name of STAFSample */request = "START WAIT COMMAND chkdsk.com WORKLOAD STAFSample"/* Pass the boot drive parameter to chkdsk */parms = "PARMS" bootdrive/* Query STAF for a variable */STAFRC = STAFSubmit("local", "var", "resolve {STAF/Config/Sep/File}")if STAFRC = 0 then filesep = STAFResultelsedo say "Unable to determine file seperator!" call STAFUnRegister RETURN STAFRCend/* Set the working directory */workdir = "WORKDIR" bootdrive||filesep/* Submit the request to STAF */say "Attempting to CHKDSK bootdrive" bootdriveSTAFRC = STAFSubmit("local", "process", request parms workdir)say "Submit Return Code="STAFRC ", Result="STAFResult/* Unregister */call STAFUnRegisterRETURN 0/*********************************************************************//* STAFAbort - If user aborts, make sure STAF unregister occurs. *//*********************************************************************/STAFAbort: call STAFUnRegister EXIT 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -