Jump to content
Sign in to follow this  
illuminon

ControlCommand and 'String'

Recommended Posts

illuminon

Hi AutoIters!

First, greeting to the forums!

Second, my problem:

Briefly: My problem is probably rooted in the difference between "string" and 'string'.

Longer: I'd like to select a combobox entry. The entries change, hence it's impossible to address the number of the entry. I'd like to copy a string out of excel and select it in the combobox.

The selection of the combobox essentially works (Handle and Syntax should be ok):

ControlCommand("[CLASS:XXX]","","[ID:8066]","SelectString","X")

However, selection based on a variable fails:

ControlCommand("[CLASS:XXX]","","[ID:8066]","SelectString",$string)

I also striped the string of the carriage return which seem to come from excel:

ControlCommand("[CLASS:XXX]","","[ID:8066]","SelectString",StringStripCR($string))

No luck either. Neither with experiments with StringToASCIIArray(). I remember from C that there was a difference between "string" and 'string'. The documentation lists in this context also 'string' but I'm at loss how this is to be done.

Thanks for a hint!

Cheers illuminon

Share this post


Link to post
Share on other sites
enaiman

Welcome to the forum,

There isn't really a difference between "string" and 'string' - you can see that here:

$a = "string"
$b = 'string'
MsgBox(0, "", "$a = "&$a&", $b = "&$b)

So, if the selection works with the string value and it doesn't when using a variable - the variable content is not the one expected. Consider using a msgbox to display the content of your $string variable. If it does look the same - look for non-printable characters (@CR, @LF and others ...).

What is the string you try to read from Excel?


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites
illuminon

Thanks for your reply!

I thought of 13 but forgot 10. Excel seems to add one such too. Anyhow, this seems to be a good approach for solving similar issues:

ArrayDisplay(StringToASCIIArray($string))

Cheers

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.