Find – Remote Processing CAMBASIC User Manual
Page 81

Comm ands - 48
FIND
Command
SYNTAX:
FIND argument
PURPOSE:
Used to locate var iables, keyw ords, and labels.
REMARK S:
This is a useful tool especially in long programs. The variations described below:
FIND keyword
This will list all the lines that contain the specified command or function
keyword. F or example, F IND PO KE
F IN D . .
Lists all lines that star t with labels. It does not list lines wh ere the lab el is
part of a GOSUB, etc. Executing FIN D GOSU B will list all instances of
a GO SUB.
FIND . . label
T h is w il l l is t t he s ub r o ut in e th a t b e gi ns w it h a s pe c if ic la b el na m e . F IN D
will continue to list every line until it encounters the label symbol (.. ) or
R E T U R N .
FIN D var iable
Lists the line of e very instan ce of the var iable nam e. It w ill help locate
conflicting variables. For exa mple, PIT and P AT have the fir st and last
letter, and the sam e length. If you execu te FIN D PI T, then lines with
PAT, PET, PIT, POT and P UT ar e also listed.
EXAMPLE:
10 MOTOR = 1
20 GOSUB . . confirm
30 PRINT “Motor OK”
40 DO
50 GOSUB .. current_test
60 UNTIL RUNAMPS > 5
70 OUT 35,43
80 COR = INP(35)
90 IF COR <= 176 THEN PRINT “Status OK”
200 . . confirm
210 CUR = INP(12)
220 IF CUR < 2 THEN F = 0 ELSE F = 1
230 RETURN
240 . .
300 . . current _test
310 RUNAMPS = 1.5*AIN(2)
320 RETURN
330 . .
>FIND RUNAMPS