!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! Insert template for DO-loop ! CALLS cjc_indent ( INDENT.TPU ) ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! PROCEDURE cjc_do_loop LOCAL acol , margin , label , counter, lo , hi; margin := get_info ( CURRENT_BUFFER , "LEFT_MARGIN" ) ; if ( margin < 7 ) then cjc_indent ; margin := get_info ( CURRENT_BUFFER , "LEFT_MARGIN" ) ; endif ; eve_return ; copy_text ( "DO " ) ; if eve$prompt_string ( "" , label , "Enter LABEL to bound DO-loop >>> " , "No label entered" ) then copy_text ( label ) ; endif ; copy_text ( " " ) ; if eve$prompt_string ( "" , counter , "Enter name of COUNTER variable >>> " , "No counter entered" ) then eve$capitalize_string ( counter ) ; copy_text ( counter + " = " ) ; endif ; if eve$prompt_string ( "" , lo , "Enter STARTING VALUE for DO-loop >>> " , "No value entered" ) then copy_text ( lo + " , ") ; endif ; if eve$prompt_string ( "" , hi , "Enter ENDING VALUE for DO-loop >>> " , "No value entered" ) then copy_text ( hi ) ; endif ; split_line ; copy_text ( label ) ; acol := get_info ( CURRENT_BUFFER , "OFFSET_COLUMN" ) ; loop exitif ( acol >= margin ) ; copy_text ( " " ) ; acol := acol + 1 ; endloop ; copy_text ( "CONTINUE" ) ; eve_return ; position ( search ( LINE_BEGIN , REVERSE ) ) ; move_vertical ( - 2 ) ; position ( search ( LINE_END , FORWARD ) ) ; cjc_indent ; eve_return ; eve_return ; eve_return ; move_vertical ( - 1 ) ; eve$position_in_middle ( mark ( NONE ) ) ; ENDPROCEDURE ; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! Insert template for IF-THEN-ELSE block ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! PROCEDURE cjc_if_block LOCAL acol , margin , condition , start_mk , flag ; margin := get_info ( CURRENT_BUFFER , "LEFT_MARGIN" ) ; if ( margin < 7 ) then cjc_indent ; margin := get_info ( CURRENT_BUFFER , "LEFT_MARGIN" ) ; endif ; eve_return ; copy_text ( "IF ( " ) ; if eve$prompt_string ( "" , condition , "Enter CONDITION for IF-block >>> " , "No condition entered" ) then copy_text ( condition ) ; endif ; copy_text ( " ) THEN" ) ; cjc_indent ; eve_return ; eve_return ; start_mk := mark ( NONE ) ; move_horizontal ( 1 ) ; loop cjc_outdent ; exitif ( NOT eve$prompt_string ( "" , condition , "ELSEIF condition [ omit] >>> " , "" ) ) ; eve_return ; copy_text ( "ELSE IF ( " + condition + " ) THEN" ) ; cjc_indent ; eve_return ; eve_return ; eve_return ; endloop ; if ( eve$insist_y_n ( "ELSE clause ? (Y/N) " ) ) then eve_return ; copy_text ( "ELSE" ) ; cjc_indent ; eve_return ; eve_return ; eve_return ; cjc_outdent ; endif ; eve_return ; copy_text ( "ENDIF" ) ; eve_return ; cjc_indent ; eve$position_in_middle ( start_mk) ; return ; ENDPROCEDURE ;