Sign in to follow this  
Followers 0
13lack13lade

stringlen or value character length

5 posts in this topic

#1 ·  Posted (edited)

hi so im working with a spreadsheet and need to determine if the cell is less than 5 then do this else do that.

so i tried using this but it didnt work ; is this not the correct way to use it? easier to just use len in excel then use if $cellLEN = <5 then send tab x 3 else send tab x 2 ?

if stringlen($code) = "<5" then
   send("{TAB 3}")
Else
   send("{TAB 2}")
EndIf
Edited by 13lack13lade

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

what about just less than?

or would you go >= 4

Edited by 13lack13lade

Share this post


Link to post
Share on other sites

$sVar = "Autoi"
$iVarLen = StringLen($sVar)

MsgBox("","",$iVarLen)

If $iVarLen > 5 Then
    MsgBox(0,"","More than 5")
ElseIf $iVarLen < 5 Then
    MsgBox(0,"","Less than 5")
ElseIf $iVarLen = 5 Then
    MsgBox(0,"","equal 5")
EndIf

Please use help file.

Press F1 when scite Win is activated search index tab, then type "operators" and you get a full list with the operators of autoit

Share this post


Link to post
Share on other sites

legend thank you! stupid me immediately jumped to the conclusion maybe stringlen not the right thing to use etc but it was, i just fail at the simple things haha

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  
Followers 0