Label index property to identify an array

General discussion on Visual GLCD Software.
Post Reply
Author
Message
chuckster35
Posts: 145
Joined: 23 Dec 2005 19:36
Location: Pa
Contact:

Label index property to identify an array

#1 Post by chuckster35 » 16 Nov 2011 20:21

Is it possible to add an index property to make an array of Labels.

Instead of:
typedef caption_txt as string[17]
dim line_number as caption_txt[8]


pos1_caption=line_number[0]
pos2_caption=line_number[1]
pos3_caption=line_number[2]
pos4_caption=line_number[3]
pos5_caption=line_number[4]
pos6_caption=line_number[5]
pos7_caption=line_number[6]
pos8_caption=line_number[7]
drawlabel(@pos1)
drawlabel(@pos2)
drawlabel(@pos3)
drawlabel(@pos4)
drawlabel(@pos5)
drawlabel(@pos6)
drawlabel(@pos7)
drawlabel(@pos8)

This:
typedef caption_txt as string[17]
dim line_number as caption_txt[8]

For index = 1 to 8
pos(index)_caption=line_number[index-1]
drawlabel(@pos.index)
next index

Post Reply

Return to “Visual GLCD General”