/* * ----------------------------------------------------------------- * Execution of this macro requires a license for uni-XEDIT Extended * for each concurrent user of the macro. * ----------------------------------------------------------------- * * * * NEXTWORD.XEDIT * * NEXTWORD.XEDIT is a macro that moves the cursor to the next word in * a line. This macro should be assigned to a PF key or CTL_key * combination by adding ONE of the following lines to your * .profile.xedit file: * * 'set pf# only macro nextword' * * where # is the number of the PF key assignment. * * 'set keyb ? command nextword' * * where ? is the CTL sequence desired for the key. * * Use NEXTWORD.XEDIT macro anywhere in a line. * * * Modification History: * * 02/14/93 twg Initial implementation * */ 'extract /line /cursor /size' if cursor.3 < 1 | cursor.3 > size.1 then do emsg 'Cursor is not on valid line' cursor cmdline end else do if cursor.4<0 then cursor.4=0 /* column 0 means off front of line to us */ ':'cursor.3 /* make line of interest current so we can see it */ 'extract /curline' p=pos(' ',curline.3,cursor.4+1) /* any blanks beyond where we are? */ if p=0 | substr(curline.3,p+1)='' /* if not, or if only blanks... */ then do /* then start off front of next line */ cursor.4=0 do until curline.3<>'' /* skip over entirely blank lines */ cursor.3=cursor.3+1 '+1' /* make next line current */ 'extract /curline' end end if cursor.4=0 /* if off front and */ then if left(curline.3,1)/==' ' /* word at start of line */ then column.1=1 /* just do col 1 */ else nop else do /* otherwise find next word using clocate */ 'cl :'p /* set to first blank beyond current position */ 'cl ~/ /' /* find start of next word */ 'extract /column' /* see where we are */ end ':'line.1 /* restore original current line */ 'cursor file' cursor.3 column.1 /* set cursor */ end exit