Hi
I need help on data type for a long line formula
I had my program worked OK on PB DOS 3.5, but I have wrong number when I changed to PBCC 4.0.
I have problem of data type, because I have a long line formula, so I have to break it into 2 lines.
When I run in PBCC 4.0 I had error in data type sine new value=-32768, in PBDOS the real value was about 20.
My break line the old variable N is now treated as a NEW DEFINITION
I have my program now in PBCC 4.0 susch as
FUNCTION PBMAIN AS LONG
LOCAL a1, a2, b1, b2,.....AS INTEGER
LOCAL c1, c2, d1, d2,....., N, b12 AS LONG
''''' N was not defined in PBDOS 3.5, and N is treated as (a NEW DEFINITION) AS INTEGER in PBCC 4.0
' examle of my 1 formula in 2 lines
a1=10: c1=22: d2=30.......
N = a1+c1+......................................................................................................a3+a4
b12= (c1+d2+..................................................................................................a4)/N
print b12
END FUNCTION
====================
I have now number N exceed limit, I checked new number in PBCC 4.0 with N = -32768.
So my new result is a wrong number for b12! which is b12 = -2123456789 or so
One formula should read as:
b12= (c1+d2 +.................................................................................................................................a4)/(a1+c1 +...................................................................................................................................a3+a4)
My questions are:
1. Do I have the continue line for formmula entry such as _ for continue as in print ?
2. Do I have to change to another new data type for longer than 12 digits, so what is the Data Type should be used ??
Thank you for your help
Can Le
I need help on data type for a long line formula
I had my program worked OK on PB DOS 3.5, but I have wrong number when I changed to PBCC 4.0.
I have problem of data type, because I have a long line formula, so I have to break it into 2 lines.
When I run in PBCC 4.0 I had error in data type sine new value=-32768, in PBDOS the real value was about 20.
My break line the old variable N is now treated as a NEW DEFINITION
I have my program now in PBCC 4.0 susch as
FUNCTION PBMAIN AS LONG
LOCAL a1, a2, b1, b2,.....AS INTEGER
LOCAL c1, c2, d1, d2,....., N, b12 AS LONG
''''' N was not defined in PBDOS 3.5, and N is treated as (a NEW DEFINITION) AS INTEGER in PBCC 4.0
' examle of my 1 formula in 2 lines
a1=10: c1=22: d2=30.......
N = a1+c1+......................................................................................................a3+a4
b12= (c1+d2+..................................................................................................a4)/N
print b12
END FUNCTION
====================
I have now number N exceed limit, I checked new number in PBCC 4.0 with N = -32768.
So my new result is a wrong number for b12! which is b12 = -2123456789 or so
One formula should read as:
b12= (c1+d2 +.................................................................................................................................a4)/(a1+c1 +...................................................................................................................................a3+a4)
My questions are:
1. Do I have the continue line for formmula entry such as _ for continue as in print ?
2. Do I have to change to another new data type for longer than 12 digits, so what is the Data Type should be used ??
Thank you for your help
Can Le
Comment