Sign in to follow this  
Followers 0
behav

need help

3 posts in this topic

hi there,

first sorry for my bad english

im trying to check a string charakter but im doing something wrong my code

$c5 = "001111111000011111110000110000000001100000000011111110001111111110011100011100000000011100000000111000110001110001100011101100000110011100011100111111110000011111000" $c6 = "000111110000011111110001110001110011000000000110111100001111111100011111111100110000111001100000110011000001100110000011001100001110011100011101111111110000011111000" $c8 = "000111111000011111110001110001111011100011110111000111001111001110001111111000111111111001110001110011000001110110000011101100000111011110011100011111111000011111000" $cK = "011110111100111101111000110011100001100110000011011100000111111000001111111000011111000000111110000001101110000011001100000110011100001100111000111111111001111111110"

For $i = 0 To StringLen($str) $ss1 = StringMid($str, $i + 1, 1) $ss2 = StringMid($c5, $i + 1, 1) MsgBox(0,"The hex color is", $ss1 & "==" & $ss2) If $ss1 == $ss2 Then $mx = $mx + 1 EndIf Next

only 3charakter are reading now and getting error

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

For $i = 0 To StringLen($str) - 1 ;You forgot to adjust the max number of the loop
    $ss1 = StringMid($str, $i + 1, 1)
    $ss2 = StringMid($c5, $i + 1, 1)
    MsgBox(0,"The hex color is", $ss1 & "==" & $ss2) ;Just a guess but isn't it binary?
    If StringCompare($ss1, $ss2) == 0 Then ;You are comparing strings not numbers
        $mx = $mx + 1
    EndIf
Next

Edited by omikron48

Share this post


Link to post
Share on other sites

For $i = 0 To StringLen($str) - 1 ;You forgot to adjust the max number of the loop
    $ss1 = StringMid($str, $i + 1, 1)
    $ss2 = StringMid($c5, $i + 1, 1)
    MsgBox(0,"The hex color is", $ss1 & "==" & $ss2) ;Just a guess but isn't it binary?
    If StringCompare($ss1, $ss2) == 0 Then ;You are comparing strings not numbers
        $mx = $mx + 1
    EndIf
Next

thank you, problem solved

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