Jump to content

need help


behav
 Share

Recommended Posts

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

Link to comment
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

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

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...