home *** CD-ROM | disk | FTP | other *** search
- $Macro_file Fortran;
- {****************************************************************************}
- { --- Mult-Edit macros for FORTRAN -- }
- {****************************************************************************}
-
- {******************************************************************************}
- { MULTI-EDIT MACRO }
- { }
- {Name: For_ind }
- { }
- {Description: This macro will perform a smart indent when the <ENTER> key is }
- { pressed. This macro is called by the macro CR. }
- { If checks for the keywords: }
- { IF DO & ELSE }
- { }
- { (C) Copyright 1988 by American Cybernetics, Inc. }
- {******************************************************************************}
- $Macro For_Ind;
- Def_str(c_str);
- def_int(t_col, T_col2);
-
- T_col2 := c_col;
- First_word;
- T_col := c_col;
- if (t_col2 < t_col) then
- t_col := t_col2;
- goto_col(T_Col);
- end;
-
- if (Cur_char <> '|0') then
- set_indent_level;
- end;
- t_col := c_col;
-
- c_str := remove_space(Get_word(' (123456789'));
- Goto_col(T_col2);
- Cr;
-
- if (T_col <> T_col2) and (Length(C_str) <> 0) and (pos(caps(c_str),'IF DO ELSE') <> 0) then
- Indent;
- end;
-
- end_macro;
-
-
- {******************************************************************************}
- { MULTI-EDIT MACRO }
- { }
- {Name: Fortemp }
- { }
- {Description: Creates Fortran language constructs based on a single character }
- { to the left of the current cursor position. }
- { These include: }
- { }
- { if () then do = , SUBROUTINE () }
- { }
- { endif continue END; }
- { }
- { (C) Copyright 1988 by American Cybernetics, Inc. }
- {******************************************************************************}
- $MACRO ForTemp;
-
- Def_int(T_col, T_col2,jx);
- T_col2 := C_col;
- left;
- T_col := C_col;
- First_word;
- if (T_col = C_col) then
- Set_indent_level;
- if (cur_char = 'I') then
- right;
- text('F () THEN');
- cr;
- cr;
- text('ENDIF');
- up;
- home;
- indent;
- jx := search_bwd(')',0);
- else
- if (cur_char = 'i') then
- right;
- text('f () then');
- cr;
- cr;
- text('endif');
- up;
- home;
- indent;
- jx := search_bwd(')',0);
- else
- if (cur_char = 'D') then
- right;
- text('O = ,');
- cr;
- cr;
- text('CONTINUE');
- up;
- home;
- indent;
- jx := search_bwd(' =',0);
- else
- if (cur_char = 'd') then
- right;
- text('o = ,');
- cr;
- cr;
- text('continue');
- up;
- home;
- indent;
- jx := search_bwd(' =',0);
- else
- if (cur_char = 'S') then
- right;
- text('UBROUTINE ()');
- cr;
- cr;
- text('RETURN');
- cr;
- text('END');
- up; up;
- home;
- indent;
- jx := search_bwd(' (',0);
- end;
- end;
- end;
- end;
- end;
- end;
-
- END_MACRO;
-
-
- $macro Formtch;
-
- end_macro;