Setup and operation chapter 2 – Remote Processing RPC-2350 User Manual

Page 14

Advertising
background image

SETUP AND OPERATION

CHAPTER 2

2-8

stops giving line numbers when two < CR> 's are
received.

3. U se labels after GO TO and G OSUB statem ents.
Do not assign line numbers (except as noted in 4
below) since they will change.

4. O N GO TO and O N GO SUB cannot use labels.
The tr ick here is to assign a line num ber w ay high in
the program count. Then, at these lines, use GOTO
.. label. NOLIN ES.BAS shows how this is done.

U s e th e A UT O s ta t em e n t t o s e gm e n t y o ur p r og r a m .
AUT O can num ber star ting at any location . T his is
useful to place ON G OTO and ON G OSUB locations.

AUTO is terminated when two sequential < CR> ’s are
received.

PROGRAMMING TIPS

Manuals can be full of information. Som etimes it’s
overwhelming. This section presents a few tips our
customers ha ve given us over the past 15 ye ars.

Finding variables, keywor ds, and labels
The F IND statem ent will search for program labels,
variable names, or even comm and keyw ords. Look in
the CAMBA SIC Programming Manual for more
information.

F a st e r, s h or t er IF - TH E N ' s
IF-THEN statements are based on zero and non-zero
flags. Consider the following program fragment

a = 5
if a then ..there

executes quicker than

a = 5
if a < > 0 then goto ..there

Notice 2 eleme nts are missing F irst is the inequality test
< > . Next is GOTO . The progr am line is an implied
GOTO.

Another var iation is

a = 5
if a goto ..there

The THEN is implied but you must supply the keyword

GOT O or GOS UB.

Use parenth esis (or brackets)
When IF-T HEN statements do not execute properly (and
formulas too), break it up using parens. For exam ple:

I F A - B *C A N D D = C * B - D / 8 OR 1 5 T H E N . . .

The question the compiler asks is "What are you doing
here?" True, there is an order of precedence, but often
times the assumptions made by the programm er vs
compiler order will differ. Use parens as shown below.

IF A-(B*(C AND D))=C*B-((D/8)OR15) THEN

Generally, you can go 7 levels of parens without
reachin g the com pilers lim it.

Advertising