! Les tests effectués sur les caractères sont un espace ou une tabulation ce qui ne se voit pas très bien dans le code !!!
Procedure dcl_style
If style = "true"
Then
style := "false";
Message('Dcl style is removed ......');
Else
style := "true";
Message('Dcl style is set ......');
Endif;
Endprocedure;
!
Procedure indent
to_copy := "";
Split_Line;
home := mark(None);
Move_Vertical(-1);
Loop
If style = "true"
Then
Exitif (Current_Character <> " ") And (Current_Character <> " ") And (Current_Character <> "$") ;
Else
Exitif (Current_Character <> " ") And (Current_Character <> " ");
Endif;
to_copy := to_copy + Current_Character;
move_horizontal(1);
!message(to_copy);
Endloop;
Position(home);
Copy_Text(to_copy);
Endprocedure;
La touche "PF1 4" associée à la procédure dcl_style sera définie :
Define_key('dcl_style',Key_name("4",Shift_key));
La touche "return" associée à la procédure indent sera définie :