{******************************************************************************
											---  Mult-Edit macros for DBase ---
*******************************************************************************}

$MACRO_FILE DBASE;

{******************************************************************************
																MULTI-EDIT MACRO

 Name: DBAMTCH

 Description:  This macro will match occurances of
		 IF / ENDIF, CASE / ENDCASE, DO WHILE / ENDDO, TEXT / ENDTEXT, ( / )
							 (C) Copyright 1988 by American Cybernetics, Inc.
													 Contributed by Julius Nadas
******************************************************************************}

$MACRO DBAMTCH TRANS;

	DEF_STR( Str1, Str2, S_var,            {Match strings}
					 Xtr2,
					 T_Str, S_str, FStr );

	DEF_INT( Direction,   {1 = search forward, 0 = backward}
					 B_Count,     {Match count.  0 = match found}
					 I_var,       {just a temp variable}
					 temp_case,   {save ignore_case flag}
					 S_Res);      {Search result}

	Refresh := False;     {Turn screen refresh off}
	temp_case := ignore_case;
	ignore_case := true;

	Mark_Pos;             { return here if no find }

	IF (Cur_Char = '(') THEN   {Setup match for '('}
		Str1 := '(';
		Xtr2 := ')';
		Str2 := ')';
		Direction := 1;
		S_Str := '(||)||$';
		GOTO Start_Match;
	END;

	IF (Cur_Char = ')') THEN   {Setup match for ')'}
		Str1 := ')';
		Xtr2 := '(';
		Str2 := '(';
		Direction := 0;
		S_Str := Str1+'||'+Str2+'||%';
		GOTO Start_Match;
	END;

 {go to the first word}
	goto_col(1);

Match_Construct:

	IF Cur_Char = ' ' THEN      {If we are on a blank space then find a word}
		Word_Right;
	END;

	T_Str := copy( Caps( Get_Word(' ') ),1,4);  {Get the current word}

	IF (T_Str = 'ELSE') or (T_Str = 'IF') THEN
		Str1 := 'IF';
		Xtr2 := 'ENDIF';
		Str2 := 'ENDI';
		S_Str := '{% *IF}||{% *ENDI}';
		GOTO Match_Down;
	END;

	IF T_Str = 'ENDI' THEN
		Str1 := 'ENDI';
		Xtr2 := 'IF';
		Str2 := 'IF';
		S_Str := '{% *IF}||{% *ENDI}';
		GOTO Match_Up;
	END;

	IF (T_Str = 'TEXT') THEN
		Str1 := 'TEXT';
		Xtr2 := 'ENDTEXT';
		Str2 := 'ENDT';
		S_Str := '{% *TEXT}||{% *ENDT}';
		GOTO Match_Down;
	END;

	IF T_Str = 'ENDT' THEN
		Str1 := 'ENDT';
		Xtr2 := 'TEXT';
		Str2 := 'TEXT';
		S_Str := '{% *TEXT}||{% *ENDT}';
		GOTO Match_Up;
	END;

	IF T_Str = 'DO' THEN
		Word_Right;
		T_Str := copy( Caps( Get_Word(' ') ),1,4);  {Get the current word}
	END;

	{ check for either a DO WHILE or a simple WHILE or LOOP or EXIT }
	IF (T_Str = 'WHIL') or (T_Str = 'EXIT') or (T_Str = 'LOOP') THEN
		Str1 := 'DO WHIL';
		Xtr2 := 'ENDDO';
		Str2 := 'ENDD';
		S_Str := '{% *DO +WHIL}||{% *ENDD}';
		GOTO Match_Down;
	END;

	{ check for either a DO CASE or  simple CASE or OTHERWISE }
	IF (T_Str = 'CASE') or (T_str = 'OTHE') THEN
		Str1 := 'DO CASE';
		Xtr2 := 'ENDCASE';
		Str2 := 'ENDC';
		S_Str := '{% *DO +CASE}||{% *ENDC}';
		GOTO Match_Down;
	END;

	IF T_Str = 'ENDD' THEN
		Str1 := 'ENDD';
		Xtr2 := 'DO WHILE';
		Str2 := 'DO WHIL';
		S_Str := '{% *DO +WHIL}||{% *ENDD}';
		GOTO Match_Up;
	END;

	IF T_Str = 'ENDC' THEN
		Str1 := 'ENDC';
		Xtr2 := 'DO CASE';
		Str2 := 'DO CASE';
			S_Str := '{% *DO +CASE}||{% *ENDC}';
		GOTO Match_Up;
	END;

	Make_Message('Looking for the Next Control Word');
	GOTO_MARK;
	S_Str := '{% *IF}||{% *ENDI}||{% *DO +WHIL}||{% *DO +CASE}||{% *ENDD}||{% *ENDC}||{% *TEXT}||{% *ENDT}';
	S_Res := Search_Fwd(S_Str,0);
	if (S_res = true) then
		Make_Message('Next Control Word');
	end else
		Make_message('no control word found');
	end;
	GOTO Macro_Exit;

Match_Up:
	Direction := 0;
	goto_col(1);
	GOTO Start_Match;

Match_Down:
	Direction := 1;

Start_Match:
	Reg_Exp_Stat := True;
	Ignore_Case := True;
	B_Count := 1;
	S_Res := 1;
	Make_Message('Matching...  Hit <ESC> to Stop.');
	Working;

MATCH_LOOP:   {Main loop}

					{If the <ESC> key is pressed while matching then abort the search}
	if check_key then
		if key1 = 27 then
			GOTO_MARK;
			Make_Message('Match Aborted.');
			goto macro_exit;
		end;
	end;

	If B_Count = 0 THEN {If match count is 0 then success}
		GOTO Found_Exit;
	END;

	If Direction = 1 THEN {Perform search based on direction}
		Right;
		S_Res := Search_Fwd(S_Str,0);
	END ELSE
		Left;
		S_Res := Search_Bwd(S_Str,0);
	END;

	If S_Res = 0 THEN   {If search failed then exit}
		GOTO Error_Exit;
	END;

	FStr := Remove_Space(Caps(Found_Str));
											 {Get the found string and capitalize it}
												{If we found the first match string then}
	IF FStr = STR1 THEN
		B_Count := B_Count + 1;   {Inc the match count}
	END ELSE
		IF FStr = STR2 THEN          {If we found the second match string then}
			B_Count := B_Count - 1;    {  decrement the match count}
		END;                         {ignore everything else}
	END;

	GOTO Match_Loop;


Error_Exit:     {Go here for unsucessfull match}
	GOTO_MARK;
	Make_Message('Did Not Find '+Xtr2);
	GOTO Macro_Exit;

Found_Exit:     {Go here for successfull match}
	POP_MARK;
	Make_Message('Found '+Xtr2);

Macro_Exit:
	ignore_case := temp_case;
	Refresh := True;
	Redraw;
END_MACRO;


{}
{******************************************************************************
																MULTI-EDIT MACRO

Name: DBA_IND

Description:  This macro will perform a smart indent when the <ENTER> key is
	pressed.  This macro is called by the macro CR.

							 (C) Copyright 1988 by American Cybernetics, Inc.
												Contributed by Terry Lovegrove
******************************************************************************}

$MACRO DBA_IND;

	DEF_STR(C_STR,S_STR,U_STR);          {Word to check for indent}
	DEF_INT(T_COL,T_COL2);   {Temp column positions}
	DEF_INT(sig_char_found,ind_count,jx);
	DEF_CHAR(found_char);

	MARK_POS;
	Reg_Exp_Stat := True;
	Refresh := False;
	LEFT;
	{Check to see if we are inside a comment}
	{Don't go back farther than 20 lines in order to improve speed}
	IF Search_Bwd('@{||@}||{(@*}||{@*)}',20) THEN
		IF (Cur_Char = '{') or (Cur_Char = '(') THEN
			IF (Cur_Char = '{') THEN
				RIGHT;
			END ELSE
				RIGHT;
				RIGHT;
			END;
			Set_Indent_Level;
			GOTO_MARK;
			Refresh := True;
			CR;
			GOTO MAC_EXIT;
		END;
	END;

	GOTO_MARK;
	MARK_POS;

	CALL SKIP_CLIP_NOISE1;
	FOUND_CHAR := CUR_CHAR;
	GOTO_MARK;
	REFRESH := TRUE;

	T_COL2 := C_COL;         {Store current position}
	FIRST_WORD;              {Go to the first word on the line}
	T_COL := C_COL;          {Store this position}

	IF T_COL2 < T_COL THEN   {If this position is greater than the original}
		T_COL := T_COL2;       {  then store the original}
		GOTO_COL(T_COL);       {  and go there}
	END;
	IF Cur_Char <> '|0' THEN {If we are beyond the end of the line then}
		SET_INDENT_LEVEL;      {  set the indent level}
	END;

	T_COL := C_COL;          {Store the current position}
													 {Get the current word, removing any extra space}
	C_STR := ' ' + REMOVE_SPACE(CAPS( GET_WORD('; (,{') )) + ' ';
	If XPOS(C_STR,' PROCEDURE FUNCTION DO CASE NEXT OTHERWISE IF FOR ',1) AND
		XPOS(' END',C_STR,1) AND
		XPOS(' ELSE',C_STR,1) THEN
		GOTO MAC_EXIT;
	End;
	Right;
	S_STR := ' ' + REMOVE_SPACE(CAPS( GET_WORD('; (,{') )) + ' ';
	GOTO_COL(T_COL2);        {Put cursor on original position}
	CR;                      {Perform a carriage return}

													 {If word in this list and not just after}
													 { a DO CASE then pull out the word}
	IF (XPOS(' END',C_STR,1) <> 0) OR
		(XPOS(' ELSE',C_STR,1) <> 0) OR
		(XPOS(C_STR,' NEXT OTHERWISE ',1)<> 0) THEN
			CALL OUTDENT;
			If C_STR = ' ENDCASE ' THEN
				CALL OUTDENT;
			END;
	ELSE
			IF (C_STR = ' CASE ') THEN
				Mark_Pos;
				Up;
				Up;
				First_Word;
				U_STR := ' ' + REMOVE_SPACE(CAPS( GET_WORD('; (,{') )) + ' ';
				Right;
				U_STR := U_STR + REMOVE_SPACE(CAPS( GET_WORD('; (,{') )) + ' ';
				Goto_Mark;
				If (U_STR <> ' DO CASE ') Then
					CALL OUTDENT;
				END;
			END;
	END;
														{If DO CASE or DO WHILE indent}
	IF (C_STR = ' DO ') AND (XPOS(S_STR,' CASE WHILE ',1)<> 0) THEN
		INDENT;
	END;

													 {If the word is in this list indent}
	IF (T_COL <> T_COL2) AND (LENGTH(C_STR) <> 0) AND
		((XPOS(C_STR,' PROCEDURE FUNCTION FOR CASE OTHERWISE IF ',1)<> 0)
		OR (XPOS(' ELSE',C_STR,1) <> 0)) THEN
			INDENT;
	END;
	GOTO MAC_EXIT;

OUTDENT:
				UNDENT;
				T_Col := C_Col;
				UP;
				MARK_POS;
				FIRST_WORD;
				T_Col := C_Col - T_Col;
				GOTO_MARK;
				If T_Col > 0 Then DEL_CHARS(T_Col); End;
				DOWN;
				RET;

SKIP_CLIP_NOISE1:

{ Here we look for the nearest preceding nonblank character.  If it is a
	closing comment then we find the  nearest opening comment.
	}

	IF (SEARCH_BWD('[~ ]', 1)) THEN
		IF (CUR_CHAR = ')') THEN
			LEFT;
			IF (CUR_CHAR = '*') THEN
				JX := SEARCH_BWD('(@*', 0);
				LEFT;
				GOTO SKIP_CLIP_NOISE1;
			END;
			RIGHT;
			SIG_CHAR_FOUND := TRUE;
			GOTO EXIT_SKIP_CLIP;
		END ELSE
			IF (CUR_CHAR = '}') THEN
				JX := SEARCH_BWD('@{', 0);
				LEFT;
				GOTO SKIP_CLIP_NOISE1;
			END;
		END;

		SIG_CHAR_FOUND := TRUE;
		GOTO EXIT_SKIP_CLIP;
	END;

{ If we failed to find a nonblank character on the current line, and the
	cursor is on line 1, we failed to find a significant character; otherwise,
	we back up a line and try again. }

	IF (C_LINE = 1) THEN
		SIG_CHAR_FOUND := FALSE;
		GOTO EXIT_SKIP_CLIP;
	END;
	UP;
	EOL;
	GOTO SKIP_CLIP_NOISE1;

EXIT_SKIP_CLIP:
	REFRESH := TRUE;
	RET;



MAC_EXIT:

END_MACRO;



{}
{******************************************************************************
																MULTI-EDIT MACRO

Name: DBATEMP

Description: Creates DBase language constructs based on a single character
						 to the left of the current cursor position.
The following constructs are created from the following templates:

			HEADF   creates a complete header for a function
			HEADP   creates a complete header for a program file
			f       For/Next
			c       CLEAR
			*       *******************************
			I       If/EndIF
			IE      If/Else/EndIF
			D       DO/EndDO
			DW      DO/While/EndDO
			DC      DO/Case/CASE/OTHERWISE/EndCASE
			F       FUNCTION/RETURN .T.
			FP      FUNCTION/RETURN .T./PARAMETERS
			U       USE
			UI      USE  INDEX
			P       PROCEDURE/RETURN
			PA      PARAMETERS
			PR      PRIVATE
			PU      PUBLIC
			PP      PROCEDURE/PARAMETERS/RETURN
			C       CASE
			@       @ ,
			@       @ Row()+1,
			@S      @ ,  SAY
			@G      @ ,   GET
			@P      @ ,   PROMPT
			K       KEYBOARD
			NORM    SET COLOR TO
			RS      RESTORE SCREEN
			RSF     RESTORE SCREEN FROM
			REV     SET COLOR TO N/W
			S       SELECT
			SS      SAVE SCREEN
			SST     SAVE SCREEN TO
			SE      SET ESCAPE OFF
			SC      SET CURSOR OFF
			SK      SET KEY
			SKT     SET KEY  TO
			SW      SET WRAP  OFF
			SM      SET MESSAGE TO
			SO      SET ON
			SF      SET OFF

							 (C) Copyright 1988 by American Cybernetics, Inc.
													Contributed by Terry Lovegrove
******************************************************************************}

$MACRO DBATEMP TRANS;

	DEF_INT(Temp_Col,Temp_Row,
					Temp_Insert,F_Col,
					S_Pos,Par_Cnt);
	DEF_STR(XStr,C_STR);
	DEF_CHAR(F_CHAR);

	Temp_Insert := Insert_Mode;
	Insert_Mode := True;
	Temp_Col := C_COL;
	FIRST_WORD;
	F_Char := Caps(Cur_Char);
	C_STR := Caps(GET_WORD(' '));
	FIRST_WORD;
	Set_Indent_Level;
	F_Col := C_Col;

	If (C_Str = 'HEADF') then
		GOTO MAKEHEADF;
	end;

	If (C_Str = 'HEADP') then
		GOTO MAKEHEADP;
	end;

	{Case sensitive templates}
	If (Cur_Char = 'f') Then
		GOTO MAKEFOR;
	END;
	If (Cur_Char = 'c') Then
		GOTO MAKECLEAR;
	End;

	{Non-Case sensitive templates}
	If (F_Char = '*') Then
		Del_Char;
		TEXT('*******************************');Cr;
		Goto End_of_Mac;
	End;

	If (F_Char = 'I') Then
		GOTO MAKEIF;
	End;

	If (F_Char = 'D') Then
		GOTO MAKEDO;
	End;

	If (F_Char = 'U') Then
		GOTO MAKEUSE;
	End;

	If (F_Char = 'P') Then
		If (C_Str = 'PA') Then
			 GOTO MAKEPARAM;
		ELSE
		If (C_Str = 'PR') Then
			 GOTO MAKEPRIV;
		ELSE
		If (C_Str = 'PU') Then
			 GOTO MAKEPUBL;
		ELSE
			 GOTO MAKEPROCEDURE;
		END;END;END;
	End;

	If (F_Char = 'F') Then
		GOTO MAKEFUNCTION;
	End;

	If (F_Char = 'C') Then
		GOTO MAKECASE;
	End;

	If (F_Char = '@') Then
		GOTO MAKEAT;
	End;

	If (F_Char = 'K') Then
		GOTO MAKEKEYBRD;
	End;

	If (C_STR = 'NORM') Then
		GOTO MAKENORM;
	End;

	If (F_Char = 'R') Then
		If (C_Str = 'REV') Then
			GOTO MAKEREV;
		ELSE
			GOTO MAKEREST;
		END;
	End;

	If (F_Char = 'S') Then
		If Length(C_Str) > 1 Then
			If XPos('S',C_Str,2) <> 0 Then
				 GOTO MAKESAVE;
			Else
				 GOTO MAKESET;
			End;
		Else
			GOTO MAKESELECT;
		End;
	End;

	{Not a proper template string}
	Goto_Col(Temp_Col);
	GOTO END_OF_MAC;

MAKEIF:
	Del_Chars(Length(C_Str));
	TEXT('If ');
	EOL;
	Cr;
	Cr;
	TEXT('EndIF');
	Up;
	Goto_Col(F_Col);
	If C_Str = 'IE' then
		Cr;
		TEXT('Else ');
		EOL;
		Cr;
		Goto_Col(F_Col);
		Up;
		Up;
	End;
	Indent;
	GOTO END_OF_MAC;

MAKEDO:
	Del_Chars(Length(C_Str));
	TEXT('DO ');

	If C_Str = 'DW' Then
		TEXT('While ');

		EOL;
	Else
		If C_Str = 'DC' Then
			TEXT('Case');

			Cr;
			Cr;
			Indent;
			TEXT('OTHERWISE');

			Cr;
			Undent;
			TEXT('EndCASE');

			Goto_Col(F_Col);
			Up;
			Up;
			Indent;
			TEXT('CASE ');

			GOTO END_OF_MAC;
		End;
	End;
	Cr;
	Cr;
	TEXT('EndDO');

	Up;
	Goto_Col(F_Col);
	Indent;
	GOTO END_OF_MAC;


MAKEFOR:
	Del_Char;
	TEXT('For ');

	Cr;
	Cr;
	TEXT('Next');

	Goto_Col(F_Col);
	Up;
	Indent;
	GOTO END_OF_MAC;

MAKECLEAR:
	Del_Char;
	TEXT('CLEAR');

	Cr;
	GOTO END_OF_MAC;

MAKEUSE:
	Del_Chars(Length(C_Str));
	TEXT('USE ');

	EOL;
	If C_Str = 'UI' then
		TEXT(' INDEX ');
	Else
		Cr;
	End;
	GOTO END_OF_MAC;

MAKEPARAM:
	Del_Chars(Length(C_STR));
	TEXT('PARAMETERS ');
	EOL;
	Cr;
	GOTO END_OF_MAC;

MAKEPRIV:
	Del_Chars(Length(C_STR));
	TEXT('PRIVATE ');
	Eol;
	Cr;
	GOTO END_OF_MAC;

MAKEPUBL:
	Del_Chars(Length(C_STR));
	TEXT('PUBLIC ');
	Eol;
	Cr;
	GOTO END_OF_MAC;

MAKEPROCEDURE:
	Del_Chars(Length(C_STR));
	TEXT('PROCEDURE ');

	EOL;
	Cr;
	Cr;
	TEXT('RETURN');

	Goto_Col(F_Col);
	Up;
	Indent;
	If C_STR = 'PP' Then
		TEXT('PARAMETERS ');

	End;
	GOTO END_OF_MAC;

MAKEFUNCTION:
	Del_Chars(Length(C_STR));
	TEXT('FUNCTION ');

	EOL;
	Cr;
	Cr;
	TEXT('RETURN .T.');

	Goto_Col(F_Col);
	Up;
	Indent;
	If C_STR = 'FP' Then
		TEXT('PARAMETERS ');

	End;
	GOTO END_OF_MAC;

MAKECASE:
	Del_Char;
	TEXT('CASE ');

	EOL;
	Cr;
	Indent;
	GOTO END_OF_MAC;

MAKEAT:
	Del_Chars(Length(C_Str));
	Temp_Col := FALSE;
	If XPos('R',C_Str,2) <> 0 then
		TEXT('@ Row()+1,');
	Else
		TEXT('@ ,');
		Temp_Col := C_Col - 1;
	End;

	If XPos('C',C_Str,2) <> 0 Then
		CALL GETCOL;
		TEXT(XSTR);
	Else
		TEXT('  ');
		Temp_Col := C_Col - 1;
	End;
	If XPos('S',C_Str,2) <> 0 Then
		TEXT('SAY ');
		If Temp_Col = 0 Then
			Temp_Col := C_Col;
		End;
	End;
	If XPos('G',C_Str,2) <> 0 Then
		If XPos('S',C_Str,2) Then
			EOL;
		End;
		TEXT (' GET ');
	End;
	If XPos('P',C_Str,2) <> 0 Then
		If XPos('S',C_Str,2) Then
			EOL;
		End;
		TEXT (' PROMPT ');
	End;

	If Temp_Col Then
		Goto_Col(Temp_Col);
	End;
	GOTO END_OF_MAC;

GETCOL:
	MARK_POS;
	Up;
	Goto_Col(1);
	If Search_Fwd('{,}{ *}{(}',1) = 0 Then
		XStr := ' ';
	Else
		Right;
		S_Pos := C_Col;
		Par_Cnt := 0;
		While Search_Fwd('[()]',1) <> 0 do
			If Cur_Char = ')' Then
				Par_Cnt := Par_Cnt - 1;
			Else
			If Cur_Char = '(' Then
				Par_Cnt := Par_Cnt + 1;
			End;End;
			Right;
		End;
		If Par_Cnt = 0 Then
			XStr := Copy(GET_LINE,S_Pos,C_Col-S_Pos);
		Else
			XStr := ' ';
		End;
	End;
	GOTO_MARK;
	RET;

MAKEKEYBRD:
	Del_Chars(Length(C_Str));
	TEXT('KEYBOARD ');
	Eol;
	Cr;
	GOTO END_OF_MAC;

MAKEREV:
	Del_Chars(Length(C_Str));
	TEXT('SET COLOR TO N/W');
	Cr;
	GOTO END_OF_MAC;

MAKENORM:
	Del_Chars(Length(C_Str));
	TEXT('SET COLOR TO ');
	Eol;
	Cr;
	GOTO END_OF_MAC;

MAKEREST:
	Del_Chars(Length(C_Str));
	TEXT('RESTORE SCREEN ');
	If XPos('F',C_Str,3) <> 0 Then
		TEXT('FROM ');
	End;
	Eol;
	Cr;
	GOTO END_OF_MAC;

MAKESAVE:
	Del_Chars(Length(C_Str));
	TEXT('SAVE SCREEN ');
	If XPos('T',C_Str,3) <> 0 Then
		TEXT('TO ');
	End;
	EOL;
	Cr;
	GOTO END_OF_MAC;

MAKESET:
	Del_Chars(Length(C_Str));
	TEXT('SET');
	If XPos('E',C_Str,2) <> 0 Then
		TEXT(' ESCAPE');
	Else
	If XPos('C',C_Str,2) <> 0 Then
		TEXT(' CURSOR');
	Else
	If XPos('K',C_Str,2) <> 0 Then
		TEXT(' KEY ');
		EOL;
		If XPos('T',C_Str,2) <> 0 Then
			TEXT(' TO');
		End;
		GOTO END_OF_MAC;
	Else
	If XPos('W',C_Str,2) <> 0 Then
		TEXT(' WRAP ');
	Else
	If XPos('M',C_Str,2) <> 0 Then
		TEXT(' MESSAGE TO ');
		GOTO END_OF_MAC;
	End;End;
	End;End;End;
	If XPos('O',C_Str,2) <> 0 Then
		TEXT(' ON');
	Else
		TEXT(' OFF');
	End;
	Cr;
	GOTO END_OF_MAC;


MAKESELECT:
	Del_Chars(Length(C_Str));
	TEXT('SELECT ');
	EOL;
	Cr;
	GOTO END_OF_MAC;

MAKEHEADF:
	Del_Chars(Length(C_Str));
	TEXT('*******************************');Cr;
	TEXT('*Function:');Cr;
	TEXT('*Notes:');Cr;
	TEXT('*');Cr;Cr;
	TEXT('*** End of          ***********');Cr;
	Up;Up;Up;Up;Up;Eol;Right;
	GOTO End_of_mac;

MAKEHEADP:
	Del_Chars(Length(c_Str));
	TEXT('*******************************');Cr;
	TEXT('*File:');Cr;
	TEXT('*Author:');Cr;
	TEXT('*Date:');Cr;
	TEXT('*Version:');cr;
	TEXT('*Notes:');cr;
	TEXT('*');Cr;Cr;
	TEXT('*** End of         .PRG *******');Cr;
	Up;Up;Up;Up;Up;Up;Up;Up;Eol;Right;
	GOTO End_of_mac;

END_OF_MAC:
	Insert_Mode := Temp_Insert;

END_MACRO;
