DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

uservariable length

I am using G2 Diadem definied variable to read strings from .asc file and display them in to a listbox. The unservariable length is unfortunately limited to 16 characters but my strings are longer than 16 characters. Is there any idea how to read more than 16 characters and display them in to a listbox?
 
Thanks
FHM 
0 Kudos
Message 1 of 7
(3,484 Views)
Hi FHM,

the limitation is fix and it is not possible to change that.
But I've created a small example which shows how to read information out of a text file and how to display this information in a listbox and or combobox. I hope this can help you.

Greetings
Walter
0 Kudos
Message 2 of 7
(3,469 Views)

Hello Walter,

Thank you very much for your helpful reply. That was exactly the suggestion which I was looking for. Unfortunatly I got a trouble to get the index of the value which I would like to select from the listbox. Lets say I would like select the expression "red" from the listbox and press "Ok" button. I wana get the idex of the expression "red". If red is on the first line Index=1. If Red is written on the line 10 index=10.

I  thought the following code could be work. But unfortunatly it doesnt. I dont know why. Do you have any idea how to get this woking?

Sub Ok_EventClick()
Dim This : Set This = Ok
Call GlobalDim (" Eventindex ")
Dim iCurrIndex : iCurrIndex = Listbox1.Value

If (iCurrIndex > 0)Then

 Eventindex = 1 + Listbox1.Value

  End If
msgbox(Eventindex)

End Sub

Let me know if you need more information.

Thanks!!!

0 Kudos
Message 3 of 7
(3,406 Views)

Hello FHM!

I think the reason is that Walter forgot to increment the loop counter 'iLoop'. Every item got the same value 0.

Just add a iLoop = iLoop + 1 in the while loop.

Hope that helps

Matthias

Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 4 of 7
(3,401 Views)
Hello FHM,

Matthias is right. I'm sorry. Here is the working version.

Greetings
Walter
0 Kudos
Message 5 of 7
(3,395 Views)
Hello FHM!
 
If you use Walter's new code you have to change your line 'If (iCurrIndex > 0) Then' to 'If (iCurrIndex >= 0) Then'.
 
Matthias
Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 6 of 7
(3,386 Views)
Hello Guys,
 
thank you very much for supporting me in this case. It works perfectly Smiley Happy
thanks again!
 
 
0 Kudos
Message 7 of 7
(3,385 Views)