Jump to content

$GUI_CHECKED and $GUI_UNCHECKED


Recommended Posts

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

Link to comment
Share on other sites

  • Moderators

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

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

  • Moderators

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

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

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