|
|||||||
Reader's Clinic - Functions and SubroutinesStefan Gilboy of Logix Consultants makes the interesting point that functions can be declared as both subroutine and function at the beginning of the program. This is especially useful in a function such as LOCKER (from utility diskette # 1). Here a dummy variable must be assigned a variable so that the routine can be called to perform an action that does not return anything. Thus the following code 0001 DECLARE FUNCTION LOCKER 0002 OPEN "TEST" TO TF THEN 0003 IF LOCKER(TF,1,"L") THEN 0004 DELETE TF,1 0005 DUM = LOCKER(TF,1,"U") 0006 END 0007 END could be replaced with 0001 DECLARE FUNCTION LOCKER 0002 DECLARE SUBROUTINE LOCKER 0003 OPEN "TEST" TO TF THEN 0004 IF LOCKER(TF,1,"L") THEN 0005 DELETE TF,1 0006 LOCKER(TF,1,"U") 0007 END 0008 END (Volume 2, Issue 1, Page 3) |
|||||||
| |||||||