Jump to content

radio buttons and filewritelog


Recommended Posts

hi!

i have a script that records when a user logs in/out of an online class, and i was wondering how do i get which radio button was clicked to be recorded into the log file? the script records the students name, time and date but i have radio buttons that say entered or exited class and i wanted to have that info also record to the log file to show what the user did and when. any ideas?

thanks, melanie

Link to comment
Share on other sites

Check out GUICtrlRead in the help file

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

Check out GUICtrlRead in the help file

ok did that and i gave it shot, but i dont think its working correctly. is there a way to assign a value to the radio button? not a number but an actual word. (this is for an online class and the radio buttons represent when a student enters or exits a class.)

i could post the entire script so u could see what im trying to do if u'd like?

heres my code for the guictrlread:

Case $msg = $radio1 And BitAND(GUICtrlRead($radio1), $GUI_CHECKED) = $GUI_CHECKED
            ;MsgBox(64, 'Info:', 'You clicked the Radio 1 and it is Checked.')
            $radiovalue=GUICtrlRead($radio1)
    Case $msg = $radio2 And BitAND(GUICtrlRead($radio2), $GUI_CHECKED) = $GUI_CHECKED
            ;MsgBox(64, 'Info:', 'You clicked on Radio 2 and it is Checked.')
            $radiovalue=GUICtrlRead($radio2)

u see anyting wrong?

thanks!! :whistle:

Link to comment
Share on other sites

ok did that and i gave it shot, but i dont think its working correctly.

Look at the example for it again.. you are not understanding what GUICtrlRead is giving you.

[edit] forgive me if I sound unhelpful.... I'm just a firm believer in helping by teaching how to find the answer instead of giving the answer

Edited by SpookMeister

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

Look at the example for it again.. you are not understanding what GUICtrlRead is giving you.

[edit] forgive me if I sound unhelpful.... I'm just a firm believer in helping by teaching how to find the answer instead of giving the answer

no its ok. i understand completely and agree. you are right tho, i am not understanding what GUICtrlRead is giving me. could you shed some light on it for me? i read the help file on it and still not really sure.

thanks

<edit>ah ha! i see its returing the value of the radio, checked or unchecked. so yeah, i dont think a radio is going to work for this. i will try a combo/drop down list. :whistle:

Edited by controlledchaos
Link to comment
Share on other sites

You gave up too quickly :whistle:

#include <GUIConstants.au3>

GUICreate("My GUICtrlRead") ; will create a dialog box that when displayed is centered

$menu1  = GUICtrlCreateMenu("File")

$n1     = GUICtrlCreateRadio("Alpha", 10, 10,80)
$n1_a   = GUICtrlCreateRadio("Bravo", 90, 10,80)
$n2     = GUICtrlCreateButton("Read", 10, 100, 50)
GUICtrlSetState(-1, $GUI_FOCUS) ; the focus is on this button

GUISetState () ; will display an empty dialog box
; Run the GUI until the dialog is closed
Do
    $msg = GUIGetMsg()
    if $msg = $n2 Then
        $n1state = GUICtrlRead($n1) ; return the state of $n1
        $n1_a_state = GUICtrlRead($n1_a) ; return the state of $n1_a
        ;MsgBox(4096,"","$n1state: " & $n1state & @CRLF & "$n1_a_state: " & $n1_a_state)
        If $n1state = $GUI_CHECKED  Then MsgBox(4096,"",GUICtrlRead($n1,1) & " is checked")
        If $n1_a_state = $GUI_CHECKED  Then MsgBox(4096,"",GUICtrlRead($n1_a,1) & " is checked")
    EndIf
Until $msg = $GUI_EVENT_CLOSE
Edited by SpookMeister

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

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