Jump to content

Help with data types


jbg1978
 Share

Recommended Posts

I have a question regarding data types. According to a page I found on this site, when a variable = "" (empty string), then it will be considered a boolean type false and have a value of zero. When I perform a logic check against it (if $strVariable = "" then...) it doesn't register as true because $strVariable actually has a value of zero. I can't make the logic check: if $strVariable = 0 then...because the variable may actually legitimately contain a zero for the value. Any thoughts on how to check if the $strVariable simply = an empty string at all? Or, how to have AutoIT explicitly treat the variable as a string?

Thank you,

jbg1978

Link to comment
Share on other sites

I have a question regarding data types. According to a page I found on this site, when a variable = "" (empty string), then it will be considered a boolean type false and have a value of zero. When I perform a logic check against it (if $strVariable = "" then...) it doesn't register as true because $strVariable actually has a value of zero. I can't make the logic check: if $strVariable = 0 then...because the variable may actually legitimately contain a zero for the value. Any thoughts on how to check if the $strVariable simply = an empty string at all? Or, how to have AutoIT explicitly treat the variable as a string?

Thank you,

jbg1978

There are String() and IsString()

$strVariable = String($strVariable)

That's string for sure.

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

  • 2 weeks later...

I've already tried some of the suggestions before I posted. Like converting to string still updated the recordset with a zero, and logic check if "" = $str still produced false for me. The length($str) did end up being the resolution though. It worked like a charm. Thank you! Thanks to everyone who posted.

Edited by jbg1978
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...