home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / ME494-3.ZIP / SRC / QSRCHIN.SRC < prev    next >
Encoding:
Text File  |  1990-05-08  |  2.7 KB  |  81 lines

  1. $MACRO QSrchIn;
  2. {*******************************MULTI-EDIT MACRO******************************
  3.  
  4. Name: QSrchIn
  5.  
  6. Description:  An alternate Search (and Replace) User Interface.  Allows
  7.                             starting search with the fewest possible keystrokes.  As soon
  8.                             as <ENTER> is pressed on the switches field, search begins.
  9.  
  10. Parameters:        /M=n    Mode, 0 = Search, 1 = Search and Replace
  11.                             /H=str Help String
  12.                             /X=n    X coordinate
  13.                             /Y=n    Y coordinate
  14.                             /SRG=str  Name of the global_str to put the search str in
  15.                             /RPG=str  Name of the global_str to put the replace str in
  16.                             /SWG=str  Name of the global_str to put the switches str in
  17.  
  18. Returns:
  19.                         Return_Int > 0 IF <Enter> WAS pressed on the switches prompt
  20.  
  21.                (C) Copyright 1989 by American Cybernetics, Inc.
  22. ******************************************************************************}
  23.         Def_Int( search_mode,x,y );
  24.         Def_Int(count);
  25.         Def_Str( help_str[40] );
  26.  
  27.         help_str := Global_Str(parse_str('/SWG=', mparm_str));
  28.  
  29.         x := parse_int('/X=',mparm_str);
  30.         y := parse_int('/Y=',mparm_str);
  31.         IF x = 0 THEN
  32.             x := 2;
  33.         END;
  34.         IF y = 0 THEN
  35.             y := 3;
  36.         END;
  37.  
  38.         search_mode := parse_int( '/M=', mparm_str );
  39.  
  40. {Initialize globals for DATA_IN}
  41.         Set_Global_Str('SRISTR_1',Global_Str(parse_str('/SRG=', mparm_str)));
  42.         Set_Global_Str('SRIPARM_1',
  43.                                 '/T=Search For:/C=1/W=63/ML=254/L=1/HISTORY=SEARCH_HISTORY');
  44.         IF (search_mode) THEN
  45.             Set_Global_Str('SRISTR_2',Global_Str(parse_str('/RRG=', mparm_str)));
  46.             Set_Global_Str('SRIPARM_2',
  47.                             '/HISTORY=REPLACE_HISTORY/T=Replace With:/C=1/W=61/ML=254/L=2');
  48.             help_str := 'SEARCH AND REPLACE';
  49.             Count := 3;
  50.         ELSE
  51.             help_str := 'SEARCH';
  52.             Count := 2;
  53.         END;
  54.  
  55.         Set_Global_Str('SRISTR_' + Str(Count),
  56.                                         Global_Str(parse_str('/SWG=', mparm_str)));
  57. {The /GO=1 parameter in this global makes the immediate search possible}
  58.         Set_Global_Str('SRIPARM_' + Str(Count),
  59.                                 '/T=Switches [G,I,N,P,B,X,R]:/C=1/W=7/GO=1/L=' + Str(Count));
  60.  
  61.  
  62.         RM('USERIN^Data_In /PRE=SR/S=1/A=3/#=' + str( count ) +    '/X=' + str(x) +
  63.                 '/Y='+Str(y) +'/T=' + help_str + '/H=' + parse_str('/H=', mparm_str));
  64.  
  65. {Set the globals based on the results of user input}
  66.         Set_Global_Str(parse_str('/SWG=', mparm_str),
  67.                                         Global_Str('SRISTR_' + str(Count)));
  68.         Set_Global_Str(parse_str('/SRG=', mparm_str), Global_Str('SRISTR_1'));
  69.         IF (search_mode) THEN
  70.             Set_Global_Str(parse_str('/RPG=', mparm_str), Global_Str('SRISTR_2'));
  71.         END;
  72.  
  73. {Deallocate DATA_IN globals}
  74.         count := 0;
  75.         WHILE count < 4 DO
  76.             Set_Global_Str( 'SRISTR_' + str(count),'');
  77.             Set_Global_Int( 'SRIINT_' + str(count),0);
  78.             ++count;
  79.         END;
  80. END_MACRO;
  81.