* * SPLITEM.KEX * * Selectively split each line of the file at just beyond a specified column. * * Works with: * * KEDIT for Windows 1.5 * KEDIT 5.0 for DOS * KEDIT 5.0 for OS/2 * parse arg col if col = "" then col = 80 else if datatype(col) \= "NUM" then do 'emsg SPLITEM Error 1: Invalid column number "'col'"' exit 1 end * Preserve current SET options and turn off AUTOSAVE 'preserve' 'set autosave off' ':1' * We'll actually split the line just after the specified column col = col + 1 * Remember if we're on the command line and then place the cursor in the text * area if command() then do OnCmdline = 1 'sos current' end else do OnCmdline = 0 'sos makecurr' end * Split each line of the file as many times as necessary do forever 'clocate :'col * Anything to the right of where we are? if after() then "down 1" * Hit the EOF yet? if focuseof() then leave 'split' 'down 1' end * Restore initial SET options 'restore' if OnCmdLine then "cursor cmdline" "top" exit 0