General TIPS: o The FIRST line MUST start with /* (start of a COMMENT) o Each COMMENT grouping MUST end with */ o Each filename MUST end with file type ".CMD" o For SELF DOCUMENTING, start comment with /*#d# for search criteria
/* Open and read a file */ FileNam = "\usr\randy\test.txt" /* define file into symbol FileNam */ Noli = 1 do while Noli <> 0 /* while value Noli NOT = 0 do following */ CurLine = linein(FileNam) /* read line into symbol LineIn */ /* */ /* do whatever to contents of CurLine */ /* */ Noli = lines(FileNam) /* put number lines UNREAD in Noli */ end call stream FileNam,'c',close /* Close the file saved in FileNam */
/* Set an Environmental variable */ TypEnv = "OS2ENVIRONMENT" rc = value('pctcp_user','ftp',TypEnv) /* sets pctcp_user to "ftp" */
/* Delete ALL files in a directory /* rc = SysFileTree('\usr\tmp\*.*'.'Izzit') /* Izzit is a SYMBOL */ do Filenum = 1 to Izzit.0 /* Izzit.0 is NUMBER of files found */ Yessitiz = word(Izzit.Filenum,5) rc = SysFileDelete(Yessitiz) end
/* Creating internal routine and calling it */ /* FIRST create the routine */ END_LINE: EndPos = arg(1) /* get PASSSED variable into EndPos */ /* get current cursor position into Row and Col */ parse value SysCurPos() with Row Col Row = Row - 1 /* back up 1 row */ Col = Col + EndPos /* Add EndPos to Col value (0) */ Call SysCurPos Row, Col /* locate cursor to Row Col */ return /* Then call it as many times as needed, changing ( ) value as needed */ say "::: PRESS Enter: " /* 12345678901234567 */ call END_LINE(17) /* there are 17 ch in "::: PRESS Enter: " */ pull YN /* get reply into symbol YN */
/* Ask for/Get user INPUT */ say " Tell me your name" say "??? WELL: " call END_LINE(10) /* uses END_LINE subroutine defined EARLIER */ pull MyName /* users reply goes into SYMBOL MyName */
Return to Randys HOME PAGE
Created Mar 01, 1996 ~ Updated Aug 09, 1996
© 1996 R.D.RISHER