/**-----------------------------------------**
   Name: ml.the
   Author: Scott Mattes, I-Net <smattes@INTERSERF.NET>
   Date:   96/11/15

   I believe this macro to be in the public
   domain since I wrote it while on a U.S.
   contract.

   To simulate, and go alittle farther, the
   cl /string target/ command that isn't
   complete in THE. This saves me much time
   over using the arrow keys.

   Locates the line the target is in and then
   place the cursor at the beginning of the
   target.

   If anything is on the command line at the
   time of execution, then that is used as
   the target; otherwise the user is prompted
   for the target.

   The search starts at either the line the
   cursor is on or the focus line, depending.

 **-----------------------------------------**/
 'extract /cmdline/'
  if cmdline.3 = ''
  then do
          'emsg Enter the target'
          'readv cmdline'
          if readv.1 = '' then exit
          cmdline.3 = readv.1
        end

'l /'cmdline.3'/'
if rc <> 0 then exit rc

'extract /curline/line/'
col = pos(cmdline.3,curline.3)

'cmsg' left(' ',length(cmdline.3))
'hit c-m'

'cursor file' line.1 col
