cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
Ady84a
Booster

how to use for loop for the values of ui_infield{3}

Dear all,
 
I have an array ( _stDrawerTypes[ ] ). The values are inserted dynamically by reading a text file.
is there a way in (ui_infield{3}) in order to use this array (_stDrawerTypes[ ]) for the values without manually typing _stDrawerTypes[1], _stDrawerTypes[2], etc
for example using for loop or other idea
 
! UI Script
ui_infield{3} "iSymbolType", 10, _yPosition, _infieldWidth, _infieldHeight,
_method, "5", 4, 2,
_infieldWidth, _infieldHeight, _imageWidth, _imageHeight,
1, _stDrawerTypes[1], "value 1",
2, _stDrawerTypes[2], "value 2",
3, _stDrawerTypes[3], "value 3",
4, _stDrawerTypes[4], "value 4",
5, .....................
6, ..............
 
Screenshot01.JPG
 
thanks in advance!
1 Solution

Accepted Solutions
Jochen Suehlo
Moderator Emeritus

I use the following routine mostly always:

! MASTER-SCRIPT

DIM _typ_best_text[], _typ_best_pic[], _typ_best_value[]
i = 1
_typ_best_text[i] = "Schnitt 1 b" : _typ_best_pic[i] = "" : _typ_best_value[i] = i : i = i + 1
_typ_best_text[i] = "Schnitt 1 c" : _typ_best_pic[i] = "" : _typ_best_value[i] = i : i = i + 1
_typ_best_text[i] = "Schnitt 2 e" : _typ_best_pic[i] = "" : _typ_best_value[i] = i : i = i + 1
_typ_best_text[i] = "Schnitt 11 f" : _typ_best_pic[i] = "" : _typ_best_value[i] = i : i = i + 1

! ---------------------------------------------------------------------- !



! PARAMETER-SCRIPT

VALUES{2} "int_typ_best", _typ_best_value, _typ_best_text



! INTERFACE-SCRIPT

UI_OUTFIELD "Bestückungstyp", dx, dy + dyO, outL, outH, 1
UI_INFIELD{3} "int_typ_best", dx2, dy, inL, inH,
8, "",
0, 0, 0, 0, 0, 0,
_typ_best_pic, _typ_best_text, _typ_best_value
dy = dy + led

! ......................... !
Jochen Suehlo . AC12-29 . MAC OSX 26 . WIN11
GDL object creation: b-prisma.de

Go to post

4 Replies 4
Jochen Suehlo
Moderator Emeritus

I use the following routine mostly always:

! MASTER-SCRIPT

DIM _typ_best_text[], _typ_best_pic[], _typ_best_value[]
i = 1
_typ_best_text[i] = "Schnitt 1 b" : _typ_best_pic[i] = "" : _typ_best_value[i] = i : i = i + 1
_typ_best_text[i] = "Schnitt 1 c" : _typ_best_pic[i] = "" : _typ_best_value[i] = i : i = i + 1
_typ_best_text[i] = "Schnitt 2 e" : _typ_best_pic[i] = "" : _typ_best_value[i] = i : i = i + 1
_typ_best_text[i] = "Schnitt 11 f" : _typ_best_pic[i] = "" : _typ_best_value[i] = i : i = i + 1

! ---------------------------------------------------------------------- !



! PARAMETER-SCRIPT

VALUES{2} "int_typ_best", _typ_best_value, _typ_best_text



! INTERFACE-SCRIPT

UI_OUTFIELD "Bestückungstyp", dx, dy + dyO, outL, outH, 1
UI_INFIELD{3} "int_typ_best", dx2, dy, inL, inH,
8, "",
0, 0, 0, 0, 0, 0,
_typ_best_pic, _typ_best_text, _typ_best_value
dy = dy + led

! ......................... !
Jochen Suehlo . AC12-29 . MAC OSX 26 . WIN11
GDL object creation: b-prisma.de
Lingwisyer
Guru

Looks like something you would use PUT GET for.

For i = 1 to drawers
PUT i, _stDrawerType[i], value[i]
next i

Do note I have no experience with infield{3} or using the put command with arrays.

AC22-29 AUS 3200Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win11 | R5 2600 | 16GB | GTX1660
Ady84a
Booster

perfect, thank you!

This is exactly what I was looking for. It worked like a charm.

 

 

Ady84a
Booster

thank you for your suggestion.

This is a good idea but I could not manage it with infield{3}  and the arrays.

 

 

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!