Jump to content

tidy error


Recommended Posts

Case $msg = $button4
            Dim $a_text
            $sFile = FileOpenDialog("select a text file...", @ScriptDir & "\config", "Text Files(*.txt.)")
            
            
            
            If $sFile = -1 Then
                MsgBox(0, "Error", "Unable to open file.")
                Exit
            EndIf
            
            SplashTextOn("LOADING...", "please wait while the list is checked for duplicates.", 150, 60, 395, 310)
            Sleep(1000)
            $whatthefuck = 0
            
            While 1
                $whatthefuck = $whatthefuck + 1
                $found = 0
                $line = FileReadLine($sFile, $whatthefuck)
                If @error = -1 Then ExitLoop
                
                If IsArray($a_text) Then
                    For $i = 0 To UBound($a_text) - 1
                        If ($a_text[$i] == $line) Then;==?
                            $found = 1
                            ExitLoop
                        EndIf
                    Next
                EndIf
                If (Not $found) Then
                    If IsArray($a_text) Then
                        ReDim $a_text[UBound($a_text) + 1]
                    Else
                        Dim $a_text[1]
                    EndIf
                    $a_text[UBound($a_text) - 1] = $line
                EndIf
            WEnd
            FileDelete($sFile)
            $h1 = FileOpen($sFile, 1)
            _ArrayDisplay($a_text, "")
            FileClose($h1)
            SplashOff()
            
            $list = FileOpen($sFile, 0)
            $set = 0
            $spacer = "."
            GUICtrlSetData($mylist, "")
            While 1
                $afc = $afc + 1
                $line = FileReadLine($list, $afc)
                If @error = -1 Then ExitLoop
                $spacer = $spacer & " "
                If Mod($afc, 2) = 0 Then;even
                    $dsply = "1 KEY: "
                Else
                    $set = $set + 1
                    $dsply = "2 KEY: "
                EndIf
                If Not StringInStr($line, "-") Then
                    $k1 = StringTrimRight($line, 12)
                    $k2 = StringTrimLeft(StringTrimRight($line, 8), 4)
                    $k3 = StringTrimLeft(StringTrimRight($line, 4), 8)
                    $k4 = StringTrimLeft($line, 12)
                    $key1 = $dsply & $k1 & "-" & $k2 & "-" & $k3 & "-" & $k4
                    $key1 = StringUpper($key1)
                Else
                    $key1 = $dsply & StringUpper($line)
                EndIf
                
                If StringLen($key1) = 24 Or StringLen($key1) = 27 Then
                    If Mod($afc, 2) <> 0 Then;odd
                        GUICtrlSetData($mylist, "                 SET " & $set & ":")
                        GUICtrlSetData($mylist, $key1)
                    Else
                        GUICtrlSetData($mylist, $key1)
                        GUICtrlSetData($mylist, $spacer)
                        GUICtrlSetData($counter, $set)
                    EndIf
                    
                Else
                    If StringLen($key1) = 0 Then
                        $line = "NOTHING! you have one... or (possibly) more, blank lines in your file! erase line " & $afc & _                            " to fix this problem."
                    EndIf
                    
                    If    StringInStr ($key1, " ",) Then
                    $line = "A SPACE!" & @LF & _
                            "REMOVE ALL SPACES to fix the problem."
                EndIf
                GUISetState(@SW_DISABLE, $GUI)
                MsgBox(262144, "hey...", "you didnt follow directions!" & @LF & _
                        "now im going to have to show you whats wrong!" & @LF & @LF & _
                        "line " & $afc & " is the offending line." & @LF & "you entered: " & $line & @LF & _
"press ok to exit program")
                Exit
;### Tidy Error: Level error -> EndIf is closing previous While
            EndIf 
            
            
            
            ReDim $keysets[$afc]
            $keysets[$afc - 1] = StringTrimLeft($key1, 8)
            
;### Tidy Error: Level error -> WEnd is closing previous Case
        WEnd

that first place i get the error..

i add "endif" and i get like.. 6 errors! i remove it, and im error free.. but then my if statement has no endif! what the hell...

this obviously isnt the ENTIRE code... and its slightly different only in the fact that i changed a few variabe names, and also edited some of my messagebox stuff.

but this should be sufficient.

(i hope)

and in case your wondering, i slightly changed _ArrayDisplay in the include folder to better suit my own needs, and its not in a messagebox anymore.. just incase that looked weird to you in my code..., theres the explanation.

and also i was having some weird problem where i had to keep adding to $whatthefuck to make it read the next line. it should automatically do that.. i dont know what i did, but it seems to run ok.. dont know why im getting the tidy error.

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

can i send you the entire code? i dont want to post it for EVERYONE to download, but

i have been working on it for awhile, and i could use some advice on how to make it better.

if your interested.

toddie_s@yahoo.com

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

  • Developers

Something is going wrong here with your version of Tidy:

If    StringInStr ($key1, " ",) Then
                    $line = "A SPACE!" & @LF & _
                            "REMOVE ALL SPACES to fix the problem."
                EndIf

Are you using a resent version of Tidy ?

Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

pretty recent. i think its the nested if statements, and there is nested else statements in there, im making it more simple, and unnesting stuff, and making the code bulkier i guess.. and its getting rid of the errors. lol

its version 1.28

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

i just installed the newest version, still dont work. i played with the code a bit, i get 5 errors now. look at this code.. the errors pop up in the strangest place.. theres no error there!

Case $msg = $button4
            Dim $a_text
            $sFile = FileOpenDialog("select a text file... Right Now!!! Punk! HURRY UP!!!", @ScriptDir & "\config", "Text Files(*.txt)" & _
                    "          ...see " & '"cdkeys.txt"?' & " duh!", 4, "cdkeys.txt")
            
            
            
            If $sFile = -1 Then
                MsgBox(0, "Error", "Unable to open file.")
                Exit
            EndIf
            
            SplashTextOn("LOADING...", "please wait while the list is checked for duplicates.", 150, 60, 395, 310)
            Sleep(1000)
            $whatthefuck = 0
            
            While 1
                $whatthefuck = $whatthefuck + 1
                $found = 0
                $line = FileReadLine($sFile, $whatthefuck)
                If @error = -1 Then ExitLoop
                
                If IsArray($a_text) Then
                    For $i = 0 To UBound($a_text) - 1
                        If ($a_text[$i] == $line) Then;==?
                            $found = 1
                            ExitLoop
                        EndIf
                    Next
                EndIf
                If (Not $found) Then
                    If IsArray($a_text) Then
                        ReDim $a_text[UBound($a_text) + 1]
                    Else
                        Dim $a_text[1]
                    EndIf
                    $a_text[UBound($a_text) - 1] = $line
                EndIf
            WEnd
            FileDelete($sFile)
            $h1 = FileOpen($sFile, 1)
            _ArrayDisplay($a_text, "")
            FileClose($h1)
            SplashOff()
            
            $list = FileOpen($sFile, 0)
            $set = 0
            $spacer = "."
            GUICtrlSetData($mylist, "")
            While 1
                $afc = $afc + 1
                $line = FileReadLine($list, $afc)
                If @error = -1 Then ExitLoop
                $spacer = $spacer & " "
                If Mod($afc, 2) = 0 Then;even
                    $dsply = "EX KEY: "
                Else
                    $set = $set + 1
                    $dsply = "D2 KEY: "
                EndIf
                If Not StringInStr($line, "-") Then
                    $k1 = StringTrimRight($line, 12)
                    $k2 = StringTrimLeft(StringTrimRight($line, 8), 4)
                    $k3 = StringTrimLeft(StringTrimRight($line, 4), 8)
                    $k4 = StringTrimLeft($line, 12)
                    $key1 = $dsply & $k1 & "-" & $k2 & "-" & $k3 & "-" & $k4
                    $key1 = StringUpper($key1)
                Else
                    $key1 = $dsply & StringUpper($line)
                EndIf
                
                If StringLen($key1) = 24 Or StringLen($key1) = 27 Then
                    If Mod($afc, 2) <> 0 Then;odd
                        GUICtrlSetData($mylist, "                 SET " & $set & ":")
                        GUICtrlSetData($mylist, $key1)
                    Else
                        GUICtrlSetData($mylist, $key1)
                        GUICtrlSetData($mylist, $spacer)
                        GUICtrlSetData($counter, $set)
                    EndIf
                EndIf
                
                If StringLen($key1) = 0 Then
                    $line = "NOTHING! you have one... or (possibly) more, blank lines in your file! erase line " & $afc & _
                            " to fix this problem." & @LF & "Do it NOW fucker."
                EndIf
                
                If    StringInStr ($key1, " ",) Then
                $line = "A SPACE! somewhere on line " & $afc & " you hit the fucking space bar while typing!" & @LF & _
                        "REMOVE ALL SPACES to fix the problem."
;### Tidy Error: Level error -> EndIf is closing previous While
            EndIf
            GUISetState(@SW_DISABLE, $GUI)
            
            If Not StringLen($key1) = 24 Or StringLen($key1) = 27 Then
                MsgBox(262144, "hey... dumbass!", "guess what, you didnt follow directions!" & @LF & _
                        "now im going to have to show you whats wrong!" & @LF & @LF & _
                        "line " & $afc & " is the offending line." & @LF & "you entered: " & $line & @LF & _
                        "read the fucking manual! goddamn..." & @LF & "press ok to exit program")
                Exit
            EndIf
;### Tidy Error: Level error -> WEnd is closing previous Case
        WEnd
        
        
        
        ReDim $keysets[$afc]
        $keysets[$afc - 1] = StringTrimLeft($key1, 8)
        
        
        
        If Mod($afc, 2) <> 0 Then
        Else
            GUISetState(@SW_DISABLE, $GUI)
        endif

edit: please excuse the vulgarity, this is a program for adults, and its supposed to make you laugh when your drunk.

p.s. the other 5 errors are at the end of the script, at the main loop, where it wend.. and endselect

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

  • Moderators

Error is further up in your script as gafrost said I'm sure. Instead of running tidy, why don't you just do the syntax check (Ctrl+F5) and see what line your error is on in SciTE.

Just a thought :whistle:

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Developers

i just installed the newest version, still dont work. i played with the code a bit, i get 5 errors now. look at this code.. the errors pop up in the strangest place.. theres no error there!

edit: please excuse the vulgarity, this is a program for adults, and its supposed to make you laugh when your drunk.

p.s. the other 5 errors are at the end of the script, at the main loop, where it wend.. and endselect

<{POST_SNAPBACK}>

PM/Mail me the whole "vulgar" script and i will check if theres a problem with Tidy or the script...

EDIT: And tell me the version of Tidy you are using...

Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

jvdzande  AT yahoo  DOT com ???

its the newest version, i just clicked your sig and downloaded it. still get errors

<{POST_SNAPBACK}>

Would appreciate when you DON'T post my email address publicly to avoid SPAM..

Jon/Larry, Could you pls get rid of it in the post ? Tnx

Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

Confirm its an issue with Tidy.

There is a TAB char after the If on line 599 which causes Tidy to get "Confused".

EDIT: It is fixed in version 1.28.10 available http://www.autoitscript.com/fileman/users/jdeb/install_tidy.exe

Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

jeez... sorry, i didnt realize

but i got the info from here

http://www.autoitscript.com/forum/index.php?showuser=19

so it was already public.

i just wasnt sure because you did not leave an email address, and that was only a username i saw under messenger contact, so i assumed you could be reached there, since you asked me to email you.. and i just wanted to verify if that was indeed the proper place to email you. after all, i did publically add my email address, i have gotten NO spam from it, i have done it before. and you could have emailed me like gafrost did. and i didnt want to spam some OTHER poor guy... if it wasnt your email.

i do apologize, although i feel an explanation on my behalf was in order.

p.s. im glad i could find a bug for you, and glad at the same time that my script is not the problem.

btw... what did you think of the code? it could be better, but i think i have some good ideas.

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

  • Developers

jeez... sorry, i didnt realize

but i got the info from here

http://www.autoitscript.com/forum/index.php?showuser=19

so it was already public.

<{POST_SNAPBACK}>

no problem...but don't think the email address is shown there... just a link to it.

btw... what did you think of the code? it could be better, but i think i have some good ideas.

<{POST_SNAPBACK}>

Didn't look at the code at all... deleted all lines and only left the one If..EndIf that showed the error.... Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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