Source language: Translate to:

variable issue

General questions about NeoBook

Moderator: Neosoft Support

variable issue

Postby stevec » Wed Oct 15, 2014 10:38 am

Ok, this sounds crazy, but I have a combobox that has several users, each user has a unique number (serial number - all numbers) associated with their name.
Below is the code.

ClearVariables "[Clipboard]"
If "[ComboBox1]" "=" "Alex"
SetVar "[Clipboard]" "XXX000-100XXX-316930"
Else
If "[ComboBox1]" "=" "Nicolas"
SetVar "[Clipboard]" "XXX000-100XXX-618373"
Else
If "[ComboBox1]" "=" "Susan"
SetVar "[Clipboard]" "XXX000-100XXX-165821"
Else
If "[ComboBox1]" "=" "Dawn"
SetVar "[Clipboard]" "XXX000-100XXX-021076"
Else
If "[ComboBox1]" "=" "Katie"
SetVar "[Clipboard]" "XXX000-100XXX-517618"
EndIf
EndIf
EndIf
EndIf
EndIf

Issue is that since the numbers have a - (minus sign) IE a dash it's acting like the numbers are being subtracted.
The clipboard contains the final number, such as 315481. I have tried using a [#45] character and get the same results.

Tried it on two windows 7 systems and I get the same.

Help!
Steve Christensen
stevec
 
Posts: 223
Joined: Fri Apr 15, 2005 7:33 am
Location: Boise, Idaho

Re: variable issue

Postby Neosoft Support » Wed Oct 15, 2014 10:43 am

NeoBook is interpreting the serial numbers as a mathematical formula. You can instruct NeoBook not to do this by adding an exclamation point to the beginning of SetVar's second parameter. For example:

SetVar "[Clipboard]" "!XXX000-100XXX-517618"

The exclamation point will not be included in the variable's contents.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: variable issue

Postby stevec » Wed Oct 15, 2014 10:52 am

Thanks.
Thought I was going crazy as the Variables in the test come up correct.
Many thanks
Steve Christensen
stevec
 
Posts: 223
Joined: Fri Apr 15, 2005 7:33 am
Location: Boise, Idaho


Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 3 guests