Avoiding Illegal Recursion

Executing a user-de￿ned function within the FUNCDEF command statement that de￿nes it is an illegal recursion.

10

OUTPUT 723;"FUNCDEF SELECT_SPAN, @";

20

OUTPUT 723;"STARTWL 800NM;STOPWL 900WL;";

30

OUTPUT

723;"SELECT_SPAN;";

40

OUTPUT

723;"@;"

On the other hand, recursion is advantageous when creating active user-de￿ned functions with the ACTDEF command.

60

OUTPUT

723;"ACTDEF

NEW_SPAN,500,nm,";

Begin de￿nition of active, user-de￿ned

 

 

 

 

function, called

NEW

 

SPAN,

that

 

 

 

 

has an initial value of 500 nm.

70

OUTPUT

723;"@MPY SP,2,NEW_SPAN;@"

Multiply NEW

 

 

SPAN by 2, then set

 

 

 

 

 

span equal to

the product.

End

 

 

 

 

de￿nition and store the function.

80

OUTPUT

723;"KEYDEF

3,NEW_SPAN;"

Assign function

to a 4USER5 key.

90

OUTPUT

723;"VARDEF

YY,0;"

Create a user-de￿ned variable , YY.

100 OUTPUT

723;"MOV YY,NEW_SPAN;"

Set variable equal to NEW

 

SPAN.

 

6-18