sample4.cmd

来自「Software Testing Automation Framework (S」· CMD 代码 · 共 81 行

CMD
81
字号
/*****************************************************************************//* Software Testing Automation Framework (STAF)                              *//* (C) Copyright IBM Corp. 2001                                              *//*                                                                           *//* This software is licensed under the Common Public License (CPL) V1.0.     *//*****************************************************************************//*********************************************************************//* Sample4.cmd - Rexx sample program using STAF                      *//*********************************************************************//* This sample writes 10 log messages to a global log file called    *//* LOGTEST and then queries them.  The size of the string written is *//* based on a random number generated.                               *//*                                                                   *//* Returns: 0, on success                                            *//*         >0, if an error is encountered                            *//*********************************************************************//* Date        Who           Comment                                 *//* ----------  ------------  --------------------------------------- *//* 03/02/1998  D. Randall    File Created                            *//*********************************************************************/SIGNAL ON HALT NAME STAFAbort/* Load STAF functions */call RxFuncAdd "STAFLoadFuncs", "RXSTAF", "STAFLoadFuncs"call STAFLoadFuncs/* Register Sample to STAF */call STAFRegister "STAF_REXX_Sample4"if RESULT \= 0 thendo  say "Error registering to STAF:" RESULT  RETURN RESULTend/* Query STAF for a variable */STAFRC = STAFSubmit("local", "var", "global resolve {STAF/Config/Machine}")if STAFRC = 0 then machine = STAFResultelsedo  say "Unable to determine machine name!"  call STAFUnRegister  RETURN STAFRCendservice = "LOG"times = 10count = 0level = errorlogtype = "log global logname "logname=LogTeststring = "Software Testing Automation Framework (STAF) (C) Copyright IBM Corp.",         "1998. All Rights Reserved"say  "Settings:" logtype logname "level" level "(times="  times ")"do count = 1 for times  message = substr(string,1,1 + random(99))  msglen = length(message)  data = "LOG GLOBAL LOGNAME" logname "LEVEL" level "MESSAGE :"msglen":"message  STAFRC = STAFSubmit("LOCAL", service, data)  if STAFRC \= 0 then    say "Log Error: " STAFRC STAFResult  say count "of" times "Logged"endsay "Querying last 10 log records..."data = "QUERY GLOBAL LOGNAME" logname "LAST 10"STAFRC = STAFSubmit("local", service, data)say STAFResult/* Unregister */call STAFUnRegisterRETURN 0/*********************************************************************//* STAFAbort - If user aborts, make sure STAF unregister occurs.     *//*********************************************************************/STAFAbort:  call STAFUnRegisterEXIT 1

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?