Sign in to follow this  
Followers 0
cppman

$GUI_CHECKED and $GUI_UNCHECKED

10 posts in this topic

im not sure what im doing wrong...

Im getting my little error message... im having a bit of brain lock, so its probably something really obvious.

If $toDos = $GUI_CHECKED Then
        
        $iFile = FileOpen(GUICtrlRead($InFile), 0)
        $oFile = FileOpen(GUICtrlRead($OutFile) & ".txt", 1)
        
        $lCt = _FileCountLines(GUICtrlRead($InFile))
        For $i = 1 to $lCt
            $String = FileReadLine($iFile, $i)
            $Cut = StringStripCR($String)
            FileWriteLine($oFile, $Cut)
        Next
        FileClose($iFile)
        FileClose($oFile)
        MsgBox(0, "Finished!", "Finished!")     
    Else
    If $toUnix = $GUI_CHECKED Then
            $iFile = FileOpen(GUICtrlRead($InFile), 0)
        $oFile = FileOpen(GUICtrlRead($OutFile) & ".txt", 1)
        
        $lCt = _FileCountLines(GUICtrlRead($InFile))
        For $i = 1 to $lCt
            $String = FileReadLine($iFile, $i)
            $Cut = StringReplace($String, @CRLF, @LF)
            FileWriteLine($oFile, $Cut)
        Next
        FileClose($iFile)
        FileClose($oFile)
        MsgBox(0, "Finished!", "Finished!") 
    Else
        MsgBox(0, "Error!", "")
    EndIf
EndIf

EndFunc

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

im guessing this isnt ur full script and u added #include <GUIConstants.au3>

and are you doing a guictrlread on the thing?

Edited by thatsgreat2345

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

im guessing this isnt ur full script and u added #inlude <GUI.au3>

hahah... thats it... i never did GuiCtrlRead... lol Edited by CHRIS95219

Share this post


Link to post
Share on other sites

#include <GUIConstants.au3>
GUICreate("My GUI radio") ; will create a dialog box that when displayed is centered

$radio1 = GUICtrlCreateRadio ("Radio 1", 10, 10, 120, 20)
GUICtrlSetState ($radio1,$GUI_CHECKED)
$radio2 = GUICtrlCreateRadio ("Radio 2", 10, 40, 120, 20)
$btn = GUICtrlCreateButton( "Test", 100, 100, 100, 20)
GUISetState ()    ; will display an  dialog box with 1 checkbox

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    
    If $msg = $btn Then
        If BitAND(GUICtrlRead($radio1), $GUI_CHECKED) = $GUI_CHECKED Then
            MsgBox(0,"test", " Radio 1 was checked   ")
        ElseIf BitAND(GUICtrlRead($radio2), $GUI_CHECKED) = $GUI_CHECKED Then
            MsgBox(0,"test", " Radio 2 was checked   ")
        EndIf
    EndIf
        
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

im guessing this isnt ur full script and u added #inlude <GUI.au3>

Never knew there was a GUI.au3 :o

If $msg = $toDos And GUICtrlRead($toDos) = $GUI_CHECKED Then

[center]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.[/center]

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

:o just trying to post quickly b4 u ahhaah couldnt spend my time actualy writing the whole thing out

well i guess i wont even bother since valuater just potsed it with the guictrlread and everything so blah

Edited by thatsgreat2345

Share this post


Link to post
Share on other sites

Never knew there was a GUI.au3 :o

If $msg = $toDos And GUICtrlRead($toDos) = $GUI_CHECKED Then

i dont think that works anymore Ron

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

i dont think that works anymore Ron

8)

No?... Try this: http://www.autoitscript.com/forum/index.ph...ndpost&p=159238

[center]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.[/center]

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

your right ... it does

I cant even remember the reason why i was taught the way i write it now

Mhz is in... he would know

8)

I don't know if it works on Radios like I posted... guess I could check... But I use the one you posted strictly for radio controls.

Edit:

Nopt it works on Radio also... hmm (Maybe I started using that when t0ddie posted his radio problem a few months ago)

Edited by SmOke_N

[center]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.[/center]

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