Beijer Electronics (formerly QSI Corporation)

Manufacturer of Mobile Data and Human Machine Interface Terminals.
It is currently Thu Jun 20, 2019 4:14 pm

All times are UTC - 7 hours

Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Jan 31, 2014 7:33 am 

Joined: Fri Jan 31, 2014 7:28 am
Posts: 11
I'm trying to get an Integer value from the DropDownListv2 and I can't seem to get it.

Using val as follows:
dim spot_convert as integer

I've tried using the val function, but I get an error "Val: Illegal value given by string". Both the methods I showed above give me the error. If I look at the value of curSelText in the debugger it is given as 2,6,1 (for example). So it's getting the proper value, but still getting the error when using val.

I'd appreciate any help.

PostPosted: Tue Feb 04, 2014 10:38 pm 
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
If your drop down list is currently displaying the string value "2,4,1", then I would expect that converting that to an integer would fail as "2,4,1" is not a valid representation of an integer as a string. What value would you expect that string to produce?

Val can be used to convert strings to integers, but the string needs to look pretty much like you might type the number. For example "45" or "1932".

Perhaps it would help if you showed some more context about what values your drop list has and what numbers you want to get from the listbox for them.


Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 7 hours

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group