(I) and DATA used more than once in a program (Oshonsoft)

Thread Starter

camerart

Joined Feb 25, 2013
3,830
Hi,
I'm reading DATA more than once in a program. (Oshonsoft)
e,g, (Not real)
For i = 0 to 5
READ
Next i

Do I need to change i to 'say' have ' ai ' and ' bi ' also ' aDATA ' and ' bDATA ' ? or can the same DIM i as byte work for all ?
Camerart
 

ericgibbs

Joined Jan 29, 2010
21,439
hi C,
You can, providing when using 'i' in a Loop, you don't come out of the Loop into another 'i' Loop.

The Data would have to be of the same Type, ie; Byte,Word etc..
I would initialise the Data to 0 or "" depending on Type before using.

I would not re-use it in an Interrupt Subr.
E
 

Thread Starter

camerart

Joined Feb 25, 2013
3,830
hi C,
You can, providing when using 'i' in a Loop, you don't come out of the Loop into another 'i' Loop.

The Data would have to be of the same Type, ie; Byte,Word etc..
I would initialise the Data to 0 or "" depending on Type before using.

I would not re-use it in an Interrupt Subr.
E
Hi E,
Ok, that makes it easier, as long as I remember the rules.
Thanks,
C.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,830
hi C,
You can, providing when using 'i' in a Loop, you don't come out of the Loop into another 'i' Loop.

The Data would have to be of the same Type, ie; Byte,Word etc..
I would initialise the Data to 0 or "" depending on Type before using.

I would not re-use it in an Interrupt Subr.
E
Hi E,
Here is a program, with char, (I) , b() and data used more than once:

Marked ?????????????????????????

I think I'll get mixed up if I use the same name in different sections, so can I make one of each, 'say' charg, ig, bg() and datag for GPS and 'say' charc for compaas?

C.
 

Attachments

Top