NUMBER ASSIGNMENT UTILITIES by Erik Warren During the course of editing a Pascal program or routine, you may find that you are using the statements similar to the following ones very often: My_Int := My_Int + 1; My_Int := My_Int - Your_Int; My_Int := 0; All of those assignment statements require a large number of keystrokes and SHIFTing. In addition to being a generally lazy person, I am also a lazy typist (and a poor one at that), so I wrote three quick routines that increment, decrement, and initialize integer variables. These are similar to routines used in Professor Niklaus Wirth's latest (and greatest) programming language, Modula-2. Inc first requires a variable passed to it, followed by a number or variable to be used as the increment value. The second parameter is added to the first. The following statements are possible uses of Inc: Inc(My_Int,1); (* My_Int := My_Int + 1; *) Inc(My_Int,Your_Int); (* My_Int := My_Int + Your_Int; *) Dec requires the same parameters as Inc, but it subtracts the second parameter from the first instead of adding the two together. The following statements are possible uses of Dec: Dec(My_Int,255); (* My_Int := My_Int - 255; *) Dec (My_Int,Your_Int); (* My_Int := My_Int - Your_Int; *) Init requires only one parameter, and it will be initialized to the value zero. For example: Init(My_Int); (* My_Int := 0; *) As you may have guessed by looking at the examples, these routines work only with Integers, but they may be changed easily to work with variables of other data types: PROCEDURE Inc(VAR Dest : Integer; Src : Integer); BEGIN Dest := Dest + Source END; (* Increment *) PROCEDURE Dec(VAR Dest : Integer; Src : Integer); BEGIN Dest := Dest - Source END; (* Decrement *) PROCEDURE Init(VAR Num : Integer); BEGIN Num := 0 END;(* Initialize *)