* * ROWCOL.KEX * * This macro, when invoked from your profile, will position the cursor at a * row and (optionally) column that you specify on the command line when * KEDITing a file. The syntax is this: * * kedit fname.ext () r [c] * * where "fname.ext" is the file to edit, "r" is the absolute line number to * position the cursor and "c" is an optional column number. You would invoke * this macro from your profile like this: * * "macro rowcol" arg(1) * * Works with: * * KEDIT 5.0 for DOS * KEDIT 5.0 for OS/2 * * Note that KEDIT for Windows 1.5 supports the LINE and COLUMN initialization * options to accomplish the same task as this macro. * * A closing right parenthesis marks the start of optional parameters pos = pos(')', arg(1)) * No extra arguments so we do nothing if pos = 0 then exit 0 numbers = substr(arg(1),pos+1) row = word(numbers, 1) col = word(numbers, 2) if row = "" then do "emsg ROWCOL Error 1: No row number specified" exit 1 end if datatype(row) \= "NUM" then do "emsg ROWCOL Error 2: Invalid row number ["row"]" exit 2 end if col = "" then col = 1 else do if datatype(col) \= "NUM" then do "emsg ROWCOL Error 3: Invalid column number ["col"]" exit 3 end end * Position the current line ":"row * Move the cursor to the current line and the specified column "sos current" "clocate :"col exit 0