Remote-processing RPC-2350 Manuel d'utilisateur Page 14

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 83
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 13
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 statements.
Do not assign line numbers (except as noted in 4
below) since they will change.
4. ON GOTO and O N GOSUB cannot use labels.
The trick here is to assign a line num ber way high in
the program count. Then, at these lines, use GOTO
.. label. NOLIN ES.BAS shows how this is done.
Use the AUTO statement to segment your program.
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. Sometimes it’s
overwhelming. This section presents a few tips our
customers have given us over the past 15 years.
Finding variables, keywor ds, and labels
The FIND statem ent will search for program labels,
variable names, or even command keyw ords. Look in
the CAMBA SIC Programming Manual for more
information.
Faster, shorter IF-THEN'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 elements are missing First 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 GOSUB.
Use parenth esis (or brackets)
When IF-THEN statements do not execute properly (and
formulas too), break it up using parens. For example:
IF A - B*C AND D = C*B - D/8 OR 15 THEN ...
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 programmer 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
reaching the compilers limit.
Vue de la page 13
1 2 ... 9 10 11 12 13 14 15 16 17 18 19 ... 82 83

Commentaires sur ces manuels

Pas de commentaire