Expand Management Programming Manual
 COMMANDS AND RESPONSES
 Examples of Commands and Responses
 ! ***************************************************************
 ! * build^cmd *
 ! ***************************************************************
 PROC build^cmd(cmd, obj^type);
 INT cmd, ! command number
 obj^type; ! object type
 BEGIN
 INT spi^err, ! returned by call on SPI procedure
 zexp^manager[0:15] := ! name of EXPAND manager
 ! process
 ["\MYSYS $ZEXP "];
 spi^err := SSINIT(exp^buf,zexp^val^buflen,zexp^val^ssid,
 zspi^val^cmdhdr,cmd,obj^type,0);
 IF spi^err THEN
 CALL handle^spi^error(spi^err); ! error on the call
 ! put the manager token in the buffer
 spi^err := SSPUTTKN(exp^buf, zspi^tkn^manager, zexp^manager);
 IF spi^err THEN
 CALL handle^spi^error(spi^err); ! error on the call
 END; ! of build^cmd
 ! ***************************************************************
 ! * probe^ncp *
 ! ***************************************************************
 PROC probe^ncp(called^sys,sel^sys);
 INT called^sys,
 sel^sys;
 BEGIN
 INT spi^err, ! returned by call to SPI procedure
 return^token, ! value of return token
 .i^ncp^name[0:11]; ! NCP name for object-name token
 STRING .s^ncp^name := @i^ncp^name '<<' 1; !string NCP name
 INT .zexp^map^probe^ncp^resp[0:zexp^map^probe^ncp^wln-1] :=
 zexp^map^probe^ncp;
 INT .probe^ncp^value(zexp^ddl^probe^ncp^def);
 ! Initialize the command buffer
 CALL build^cmd(zcom^cmd^probe, zcom^obj^process);
 ! Put the object-name token ("$NCP") in the buffer
 i^ncp^name[0] := 4; ! length of string
 s^ncp^name[2] ':=' ["$NCP"]; ! value of string
 spi^err := SSPUTTKN(exp^buf, zcom^tkn^objname, s^ncp^name);
 IF spi^err THEN
 CALL handle^spi^error(spi^err); ! error on the call
 7-128










