home *** CD-ROM | disk | FTP | other *** search
- $MACRO QSrchIn;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: QSrchIn
-
- Description: An alternate Search (and Replace) User Interface. Allows
- starting search with the fewest possible keystrokes. As soon
- as <ENTER> is pressed on the switches field, search begins.
-
- Parameters: /M=n Mode, 0 = Search, 1 = Search and Replace
- /H=str Help String
- /X=n X coordinate
- /Y=n Y coordinate
- /SRG=str Name of the global_str to put the search str in
- /RPG=str Name of the global_str to put the replace str in
- /SWG=str Name of the global_str to put the switches str in
-
- Returns:
- Return_Int > 0 IF <Enter> WAS pressed on the switches prompt
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- Def_Int( search_mode,x,y );
- Def_Int(count);
- Def_Str( help_str[40] );
-
- help_str := Global_Str(parse_str('/SWG=', mparm_str));
-
- x := parse_int('/X=',mparm_str);
- y := parse_int('/Y=',mparm_str);
- IF x = 0 THEN
- x := 2;
- END;
- IF y = 0 THEN
- y := 3;
- END;
-
- search_mode := parse_int( '/M=', mparm_str );
-
- {Initialize globals for DATA_IN}
- Set_Global_Str('SRISTR_1',Global_Str(parse_str('/SRG=', mparm_str)));
- Set_Global_Str('SRIPARM_1',
- '/T=Search For:/C=1/W=63/ML=254/L=1/HISTORY=SEARCH_HISTORY');
- IF (search_mode) THEN
- Set_Global_Str('SRISTR_2',Global_Str(parse_str('/RRG=', mparm_str)));
- Set_Global_Str('SRIPARM_2',
- '/HISTORY=REPLACE_HISTORY/T=Replace With:/C=1/W=61/ML=254/L=2');
- help_str := 'SEARCH AND REPLACE';
- Count := 3;
- ELSE
- help_str := 'SEARCH';
- Count := 2;
- END;
-
- Set_Global_Str('SRISTR_' + Str(Count),
- Global_Str(parse_str('/SWG=', mparm_str)));
- {The /GO=1 parameter in this global makes the immediate search possible}
- Set_Global_Str('SRIPARM_' + Str(Count),
- '/T=Switches [G,I,N,P,B,X,R]:/C=1/W=7/GO=1/L=' + Str(Count));
-
-
- RM('USERIN^Data_In /PRE=SR/S=1/A=3/#=' + str( count ) + '/X=' + str(x) +
- '/Y='+Str(y) +'/T=' + help_str + '/H=' + parse_str('/H=', mparm_str));
-
- {Set the globals based on the results of user input}
- Set_Global_Str(parse_str('/SWG=', mparm_str),
- Global_Str('SRISTR_' + str(Count)));
- Set_Global_Str(parse_str('/SRG=', mparm_str), Global_Str('SRISTR_1'));
- IF (search_mode) THEN
- Set_Global_Str(parse_str('/RPG=', mparm_str), Global_Str('SRISTR_2'));
- END;
-
- {Deallocate DATA_IN globals}
- count := 0;
- WHILE count < 4 DO
- Set_Global_Str( 'SRISTR_' + str(count),'');
- Set_Global_Int( 'SRIINT_' + str(count),0);
- ++count;
- END;
- END_MACRO;
-