Re: x=4? Function (correct version) Message #2 Posted by Vieira, Luiz C. (Brazil) on 1 Oct 2002, 6:38 a.m., in response to message #1 by Shawn
Hi;
I posted a solution before (30 Sept 2002, 9:24 p.m.) with mistyped values; this is correct.
There is an X=Y? function that will do what you want. Look at the samples bellow: (consider FIX 04 as default)
 you already have a number in the Xregister; the display looks:
Y: (anything)
X: (your #)
 you place the number you want to compare: (eg: 4) the display looks:
Y: (your #)
X: 4.0000
 now you use the function X=Y?; if your number is 4.0000, the display looks:
Yes
X: 4.0000
 if your number is not 4.0000, the display looks:
No
X: 4.0000
If you are entering a program, you can choose from both:
1) use specific LBL functions (LBL 01, LBL 02, etc.)
If you get in a point where the integer part of the number in the Xregister is 1, 2, 3 or 4, you do not need to use X=Y? function; instead, GTO IND ST X will work better. Your program would look like this: (consider step # 20 as a personal choice)
(first program steps)
.
19 PROMPT (you will input your control # here: 1, 2, 3 or 4)
20 GTO IND ST X
21 LBL 01
(steps when X=1)
.
29 RTN
30 LBL 02
(steps when X=2)
.
39 RTN
40 LBL 03
(steps when X=3)
.
.
49 RTN
50 LBL 04
(steps when X=4)
.
.
59 RTN
60 (rest of the program)
2) If your labels have different numbers, your program can be like this:
(first program steps)
.
19 PROMPT (you input your control # here)
20 1
21 X=Y?
22 GTO xx (label with steps when X=1)
23 CLX
24 2
25 X=Y?
26 GTO yy (label with steps when X=2)
27 CLX
28 3
29 X=Y?
30 GTO zz (label with steps when X=3)
31 CLX
32 4
33 X=Y?
34 GTO ww (label with steps when X=4)
35 ...
.
.
nn LBL xx
(steps when X=1)
.
.
.
If you only have options for 1, 2, 3 or 4, you can eliminate steps 31 to 34; like this:
(first program steps)
.
19 PROMPT (you input your control # here)
20 1
21 X=Y?
22 GTO xx (label with steps when X=1)
23 CLX
24 2
25 X=Y?
26 GTO yy (label with steps when X=2)
27 CLX
28 3
29 X=Y?
30 GTO zz (label with steps when X=3)
(steps when X=4)
.
.
RTN
nn LBL xx
(steps when X=1)
.
.
.
If you still need help OR want to know other possibilities and techniques, post your specific problem or email me directly.
Best regards.
