Jump to content
Sign in to follow this  
Gumma

Combox Issue

Recommended Posts

Gumma

#include <GUIConstantsEx.au3>
#include <GUIComboBox.au3>

Local $ES_MULTILINE

; Curent GenericCombo text
$sCurrGenericData = ""

; Create GUI

$Form1_1 = GUICreate("YKHC Data Handler", 937, 520, 175, 124)

$MedPut = GUICtrlCreateCombo("", 488, 104, 265, 25)
GUICtrlSetData(-1, "Rx: Hydrocodone/Acetaminophen 5/500mg|Rx: Penicillin VK 500mg|Rx: Clindamycin 150mg|Rx: Acetaminophen 325mg|Rx: Ibuprofen 400mg|Rx: Tylenol No. 3|Rx: Chlorhexidine Oral Rinse 0.12%|Rx: Prevident Rinse (0.2% Neutral NaF)|Rx: Prevident 5000 Plus toothpaste (1.1% NaF)|Rx: Amoxicillin 500mg|Rx: Acetaminophen chewable tablets 80mg|Rx: Clindamycin oral solution 75mg/5ml|Rx: Amoxicillin Suspension 250mg/5ml")
_GUICtrlComboBox_SetEditText($MedPut, "Rx: Penicillin VK 500mg")  ; If I put Rx: Hydrocodone/Acetaminophen 5/500mg it updates, if I put Rx: Penicillin VK 500mg it won't start w/ default disp values

$Label14 = GUICtrlCreateLabel("Meds:", 432, 104, 33, 17)

$DispPut = GUICtrlCreateCombo("", 488, 136, 250, 21)
GUICtrlSetData(-1, "Disp: Two (2) tabs|Disp: Four (4) tabs|Disp: Eight (8) tabs|Disp: Twelve (12) tabs|Disp: Sixteen (16) tabs|Disp: Fourty (40) tabs")


$Label15 = GUICtrlCreateLabel("Disp:", 432, 136, 28, 17)
$SigPut = GUICtrlCreateEdit("", 488, 168, 265, 63, $ES_MULTILINE)
$Label16 = GUICtrlCreateLabel("Sig:", 432, 168, 19, 17)
$PreviewPut = GUICtrlCreateEdit("Input1", 488, 264, 265, 84, $ES_MULTILINE)
$PreviewButton = GUICtrlCreateButton("Preview", 488, 360, 80, 34)
$Label17 = GUICtrlCreateLabel("", 432, 264, 45, 17)

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $PreviewButton
            $Med = GUICtrlRead ($MedPut, 1)
            $Disp = GUICtrlRead ($DispPut, 1)
            $Sig = GUICtrlRead ($SigPut, 1)
            GUICtrlSetData($PreviewPut, $Med & @CRLF & $Disp & @CRLF & $Sig)
            $PreviewPut = GUICtrlRead ($PreviewPut, 1)
            ClipPut($PreviewPut)


    EndSwitch

    ; Read GenericCombo selection
    $sGenericData = GUICtrlRead($MedPut, 1)
    ; If it has changed AND the combo is closed - if we do not check for closure, the code actions while we scan the dropdown list
    If $sGenericData <> $sCurrGenericData AND _GUICtrlComboBox_GetDroppedState($MedPut) Then
        ; Reset the current text so prevent flicker from constant redrawing
        $sCurrGenericData = $sGenericData
        ; Hide/Show the combos depending on the selection
        Switch $sGenericData
            Case "Rx: Hydrocodone/Acetaminophen 5/500mg"
                GUICtrlSetData($DispPut, "Disp: Twelve (12) tabs")
                GUICtrlSetData($SigPut, "Sig: 1 tablet every 6 hours as needed for pain.")

            Case "Rx: Penicillin VK 500mg"
            GUICtrlSetData($DispPut, "Disp: Twenty-eight (28) tabs")
               GUICtrlSetData($SigPut, "Sig: 1 tablet PO every 6 hours (QID), until gone.")

            Case "Rx: Clindamycin 150mg"
            GUICtrlSetData($DispPut, "Disp: Fifty-six (56)")
            GUICtrlSetData($SigPut, "Sig: 2 tablets PO (QID) until gone.")

            Case "Rx: Acetaminophen 325mg"
            GUICtrlSetData($DispPut, "Disp: Twenty-four (24) tabs")
            GUICtrlSetData($SigPut, "Sig: 2-3 tablets every 6 hours as needed for pain.")

            Case "Rx: Ibuprofen 400mg"
            GUICtrlSetData($DispPut, "Disp: Forty (40) tabs")
            GUICtrlSetData($SigPut, "Sig: 1 or 2 tablets q6h prn pain.")

            Case "Rx: Tylenol No. 3"
            GUICtrlSetData($DispPut, "Disp: Four (4) tabs")
            GUICtrlSetData($SigPut, "Sig: 1 or 2 tablets q6h prn pain.")

            Case "Rx: Chlorhexidine Oral Rinse 0.12%"
            GUICtrlSetData($DispPut, "Disp: 1 bottle (473ml)")
            GUICtrlSetData($SigPut, "Sig: 1/2 oz swish for 30 sec bid for 7-14 days")

            Case "Rx: Prevident Rinse (0.2% Neutral NaF)"
            GUICtrlSetData($DispPut, "Disp: 1 bottle (473ml)")
            GUICtrlSetData($SigPut, "Sig: 1/2 oz swish three times a week.")

            Case "Rx: Prevident 5000 Plus toothpaste (1.1% NaF)"
            GUICtrlSetData($DispPut, "Disp: 1 tube (1.8 oz)")
            GUICtrlSetData($SigPut, "Sig: brush on teeth for two minutes once per day")

            Case "Rx: Amoxicillin 500mg"
            GUICtrlSetData($DispPut, "Disp: Four (4) tabs")
            GUICtrlSetData($SigPut, "Sig: 4 tablets 1 hour before tx.")

            Case "Rx: Acetaminophen chewable tablets 80mg"
            GUICtrlSetData($DispPut, "Disp: One bottle (30 tabs)")
            GUICtrlSetData($SigPut, "Sig: take as directed on the package (do not exceed 10mg/kg per dose) every 4-6 hours as needed for pain.")

            Case "Rx: Clindamycin oral solution 75mg/5ml"
            GUICtrlSetData($DispPut, "Disp:30mg/kg/day")
            GUICtrlSetData($SigPut, "Sig: taken as 4 equal doses per day for 7 days.")

            Case "Rx: Amoxicillin Suspension 250mg/5ml"
            GUICtrlSetData($DispPut, "Disp: One bottle (150ml)")
            GUICtrlSetData($SigPut, "Sig: 40mg/kg/day taken as 3 equal doses per day for 10 days.")


        EndSwitch
    EndIf
WEnd

I have a combo box here that when I switch the value of the med, it should update the disp and sig as well. It does this, but not without error. If I run the script and select the medication via mouse click to "Rx: Hydrocodone..." the values update appropriately. However, if I immediately select "Rx: Penicillin..." the Disp value remains teh same, but the sig value changes as it should. I've noticed that if I also just open the program and use the down error, the disp values will remain the same until I hit "Rx: Tylenol No. 3" at which time they'll change to the correct value. Granted, none of this is repeatable 100% of the time, so if you just play with it, you'll see what I mean.

Also - why won't this work if I use the arrow keys to scroll through the items?

It almost seems to me like this is a program-time related issue. If I use the same method as above using mouse selection of "Rx: Hydrocodone..." , then WAIT for 10 seconds after selection "Rx: Penicillin...", the Disp values update correctly. So if it is a time/processing issue, is there a way to make it more... instant?

I can't afford to have any computer related errors when talking about prescriptions, so any help would be greatly appreciated! The script, at present, seems very unreliable. :mellow:

Share this post


Link to post
Share on other sites
AdamUL

There were a few problems that I noticed about your script.

1. The following statement would not allow your GUI to be updated.

If $sGenericData <> $sCurrGenericData AND _GUICtrlComboBox_GetDroppedState($MedPut) Then
The "AND _GUICtrlComboBox_GetDroppedState($MedPut)" was causing the problem. I replaced it with

If $sGenericData <> $sCurrGenericData Then
and it is working fine for me without it replacing data while looking through the dropdown list. Only after selecting an item did it change the rest of the data in the GUI.

2. Your GUICtrlSetData statments in the $sGenericData Switch statement was adding data to the $DispPut Combo, but was not setting it as the default. As demonstrated in you problem with getting the GUI to update with the "Rx: Penicillin VK 500mg" data in the $DispPut Combo. It was adding "Disp: Twenty-eight (28) tabs" to the $DispPut Combo, but it was not in your list when you defined the Combo. As quoted from the help file, "For Combo or List control : If the 'data' corresponds to an already existing entry it is set as the default.", but it was not already in the $DispPut Combo so it didn't get set as the default. The third parameter of GUICtrlSetData is setting the default value for the Combo. So as an example for Switch case "Rx: Penicillin VK 500mg" the GUICtrlSetData statement should be

GUICtrlSetData($DispPut, "Disp: Twenty-eight (28) tabs", "Disp: Twenty-eight (28) tabs")

Here is an edited version of your script that is working as you described you would like it to, including being able to use the arrow keys for the $MedPut Combo. I only changed the things I described above.

#include <GUIConstantsEx.au3>
#include <GUIComboBox.au3>

Local $ES_MULTILINE

; Curent GenericCombo text
$sCurrGenericData = ""

; Create GUI

$Form1_1 = GUICreate("YKHC Data Handler", 937, 520, 175, 124)

$MedPut = GUICtrlCreateCombo("", 488, 104, 265, 25)
GUICtrlSetData(-1, "Rx: Hydrocodone/Acetaminophen 5/500mg|Rx: Penicillin VK 500mg|Rx: Clindamycin 150mg|Rx: Acetaminophen 325mg|Rx: Ibuprofen 400mg|Rx: Tylenol No. 3|Rx: Chlorhexidine Oral Rinse 0.12%|Rx: Prevident Rinse (0.2% Neutral NaF)|Rx: Prevident 5000 Plus toothpaste (1.1% NaF)|Rx: Amoxicillin 500mg|Rx: Acetaminophen chewable tablets 80mg|Rx: Clindamycin oral solution 75mg/5ml|Rx: Amoxicillin Suspension 250mg/5ml")
_GUICtrlComboBox_SetEditText($MedPut, "Rx: Penicillin VK 500mg")  ; If I put Rx: Hydrocodone/Acetaminophen 5/500mg it updates, if I put Rx: Penicillin VK 500mg it won't start w/ default disp values

$Label14 = GUICtrlCreateLabel("Meds:", 432, 104, 33, 17)

$DispPut = GUICtrlCreateCombo("", 488, 136, 250, 21)
GUICtrlSetData(-1, "Disp: Two (2) tabs|Disp: Four (4) tabs|Disp: Eight (8) tabs|Disp: Twelve (12) tabs|Disp: Sixteen (16) tabs|Disp: Fourty (40) tabs")


$Label15 = GUICtrlCreateLabel("Disp:", 432, 136, 28, 17)
$SigPut = GUICtrlCreateEdit("", 488, 168, 265, 63, $ES_MULTILINE)
$Label16 = GUICtrlCreateLabel("Sig:", 432, 168, 19, 17)
$PreviewPut = GUICtrlCreateEdit("Input1", 488, 264, 265, 84, $ES_MULTILINE)
$PreviewButton = GUICtrlCreateButton("Preview", 488, 360, 80, 34)
$Label17 = GUICtrlCreateLabel("", 432, 264, 45, 17)

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $PreviewButton
            $Med = GUICtrlRead ($MedPut, 1)
            $Disp = GUICtrlRead ($DispPut, 1)
            $Sig = GUICtrlRead ($SigPut, 1)
            GUICtrlSetData($PreviewPut, $Med & @CRLF & $Disp & @CRLF & $Sig)
            $PreviewPut = GUICtrlRead ($PreviewPut, 1)
            ClipPut($PreviewPut)


    EndSwitch

    ; Read GenericCombo selection
    $sGenericData = GUICtrlRead($MedPut, 1)
    ; If it has changed AND the combo is closed - if we do not check for closure, the code actions while we scan the dropdown list
;~     If $sGenericData <> $sCurrGenericData AND _GUICtrlComboBox_GetDroppedState($MedPut) Then
    If $sGenericData <> $sCurrGenericData Then
        ; Reset the current text so prevent flicker from constant redrawing
        $sCurrGenericData = $sGenericData
        ; Hide/Show the combos depending on the selection
        Switch $sGenericData
            Case "Rx: Hydrocodone/Acetaminophen 5/500mg"
;~                 GUICtrlSetData($DispPut, "Disp: Twelve (12) tabs")
                GUICtrlSetData($DispPut, "Disp: Twelve (12) tabs", "Disp: Twelve (12) tabs")
                GUICtrlSetData($SigPut, "Sig: 1 tablet every 6 hours as needed for pain.")

            Case "Rx: Penicillin VK 500mg"
;~             GUICtrlSetData($DispPut, "Disp: Twenty-eight (28) tabs")
            GUICtrlSetData($DispPut, "Disp: Twenty-eight (28) tabs", "Disp: Twenty-eight (28) tabs")
            GUICtrlSetData($SigPut, "Sig: 1 tablet PO every 6 hours (QID), until gone.")

            Case "Rx: Clindamycin 150mg"
;~             GUICtrlSetData($DispPut, "Disp: Fifty-six (56)")
            GUICtrlSetData($DispPut, "Disp: Fifty-six (56)", "Disp: Fifty-six (56)")
            GUICtrlSetData($SigPut, "Sig: 2 tablets PO (QID) until gone.")

            Case "Rx: Acetaminophen 325mg"
;~             GUICtrlSetData($DispPut, "Disp: Twenty-four (24) tabs")
            GUICtrlSetData($DispPut, "Disp: Twenty-four (24) tabs", "Disp: Twenty-four (24) tabs")
            GUICtrlSetData($SigPut, "Sig: 2-3 tablets every 6 hours as needed for pain.")

            Case "Rx: Ibuprofen 400mg"
;~             GUICtrlSetData($DispPut, "Disp: Forty (40) tabs")
            GUICtrlSetData($DispPut, "Disp: Forty (40) tabs", "Disp: Forty (40) tabs")
            GUICtrlSetData($SigPut, "Sig: 1 or 2 tablets q6h prn pain.")

            Case "Rx: Tylenol No. 3"
;~             GUICtrlSetData($DispPut, "Disp: Four (4) tabs")
            GUICtrlSetData($DispPut, "Disp: Four (4) tabs", "Disp: Four (4) tabs")
            GUICtrlSetData($SigPut, "Sig: 1 or 2 tablets q6h prn pain.")

            Case "Rx: Chlorhexidine Oral Rinse 0.12%"
;~             GUICtrlSetData($DispPut, "Disp: 1 bottle (473ml)")
            GUICtrlSetData($DispPut, "Disp: 1 bottle (473ml)", "Disp: 1 bottle (473ml)")
            GUICtrlSetData($SigPut, "Sig: 1/2 oz swish for 30 sec bid for 7-14 days")

            Case "Rx: Prevident Rinse (0.2% Neutral NaF)"
;~             GUICtrlSetData($DispPut, "Disp: 1 bottle (473ml)")
            GUICtrlSetData($DispPut, "Disp: 1 bottle (473ml)", "Disp: 1 bottle (473ml)")
            GUICtrlSetData($SigPut, "Sig: 1/2 oz swish three times a week.")

            Case "Rx: Prevident 5000 Plus toothpaste (1.1% NaF)"
;~             GUICtrlSetData($DispPut, "Disp: 1 tube (1.8 oz)")
            GUICtrlSetData($DispPut, "Disp: 1 tube (1.8 oz)", "Disp: 1 tube (1.8 oz)")
            GUICtrlSetData($SigPut, "Sig: brush on teeth for two minutes once per day")

            Case "Rx: Amoxicillin 500mg"
;~             GUICtrlSetData($DispPut, "Disp: Four (4) tabs")
            GUICtrlSetData($DispPut, "Disp: Four (4) tabs", "Disp: Four (4) tabs")
            GUICtrlSetData($SigPut, "Sig: 4 tablets 1 hour before tx.")

            Case "Rx: Acetaminophen chewable tablets 80mg"
;~             GUICtrlSetData($DispPut, "Disp: One bottle (30 tabs)")
            GUICtrlSetData($DispPut, "Disp: One bottle (30 tabs)", "Disp: One bottle (30 tabs)")
            GUICtrlSetData($SigPut, "Sig: take as directed on the package (do not exceed 10mg/kg per dose) every 4-6 hours as needed for pain.")

            Case "Rx: Clindamycin oral solution 75mg/5ml"
;~             GUICtrlSetData($DispPut, "Disp:30mg/kg/day")
            GUICtrlSetData($DispPut, "Disp:30mg/kg/day", "Disp:30mg/kg/day")
            GUICtrlSetData($SigPut, "Sig: taken as 4 equal doses per day for 7 days.")

            Case "Rx: Amoxicillin Suspension 250mg/5ml"
;~             GUICtrlSetData($DispPut, "Disp: One bottle (150ml)")
            GUICtrlSetData($DispPut, "Disp: One bottle (150ml)", "Disp: One bottle (150ml)")
            GUICtrlSetData($SigPut, "Sig: 40mg/kg/day taken as 3 equal doses per day for 10 days.")


        EndSwitch
    EndIf
WEnd

Adam

Share this post


Link to post
Share on other sites
Melba23

Gumma,

A few problems in the script:

1. $DispPut is a Combo, so using GUICtrlSetData just changes the contents of the dropdown list, not the editbox at the top - you need to use _GUICtrlComboBox_SetEditText.

2. When you read the combo to get the $Disp variable, you have not actually selected anything, so GUICtrlRead will not work - you need to use _GUICtrlComboBox_GetEditText to read what you have just put in the editbox in the step above.

3. Look at these lines:

GUICtrlSetData($PreviewPut, $Med & @CRLF & $Disp & @CRLF & $Sig)
$PreviewPut = GUICtrlRead($PreviewPut)
ClipPut($PreviewPut)

You are using the same variable for the ControlID of the editbox AND its contents - you have overwritten the ControlID so you can no longer access the Editbox! You need to use differnt variables like this

GUICtrlSetData($PreviewPut, $Med & @CRLF & $Disp & @CRLF & $Sig)
$Content_PreviewPut = GUICtrlRead($PreviewPut)
ClipPut($Content_PreviewPut)

4. You needed to check that the combo was closed, not open, when updating the other controls - _GUICtrlComboBox_GetDroppedState($MedPut) = False.

I think the whole thing is a little better now: :mellow:

#include <GUIConstantsEx.au3>
#include <EditConstants.au3>
#include <GUIComboBox.au3>

; Curent GenericCombo text
$sCurrGenericData = ""

; Create GUI

$Form1_1 = GUICreate("YKHC Data Handler", 937, 520, 175, 124)

$MedPut = GUICtrlCreateCombo("", 488, 104, 265, 25)
GUICtrlSetData(-1, "Rx: Hydrocodone/Acetaminophen 5/500mg|Rx: Penicillin VK 500mg|Rx: Clindamycin 150mg|Rx: Acetaminophen 325mg|Rx: Ibuprofen 400mg|Rx: Tylenol No. 3|Rx: Chlorhexidine Oral Rinse 0.12%|Rx: Prevident Rinse (0.2% Neutral NaF)|Rx: Prevident 5000 Plus toothpaste (1.1% NaF)|Rx: Amoxicillin 500mg|Rx: Acetaminophen chewable tablets 80mg|Rx: Clindamycin oral solution 75mg/5ml|Rx: Amoxicillin Suspension 250mg/5ml")
_GUICtrlComboBox_SetEditText($MedPut, "Rx: Penicillin VK 500mg")  ; If I put Rx: Hydrocodone/Acetaminophen 5/500mg it updates, if I put Rx: Penicillin VK 500mg it won't start w/ default disp values

$Label14 = GUICtrlCreateLabel("Meds:", 432, 104, 33, 17)

$DispPut = GUICtrlCreateCombo("", 488, 136, 265, 21)
GUICtrlSetData(-1, "Disp: Two (2) tabs|Disp: Four (4) tabs|Disp: Eight (8) tabs|Disp: Twelve (12) tabs|Disp: Sixteen (16) tabs|Disp: Fourty (40) tabs")

$Label15 = GUICtrlCreateLabel("Disp:", 432, 136, 28, 17)
$SigPut = GUICtrlCreateEdit("", 488, 168, 265, 63, $ES_READONLY)
$Label16 = GUICtrlCreateLabel("Sig:", 432, 168, 19, 17)
$PreviewPut = GUICtrlCreateEdit("", 488, 264, 265, 84, $ES_READONLY)
$PreviewButton = GUICtrlCreateButton("Preview", 488, 360, 80, 34)
$Label17 = GUICtrlCreateLabel("", 432, 264, 45, 17)

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $PreviewButton
            $Med = GUICtrlRead($MedPut)
            ConsoleWrite($Med & @CRLF)
            $Disp = _GUICtrlComboBox_GetEditText($DispPut)
            ConsoleWrite($Disp & @CRLF)
            $Sig = GUICtrlRead($SigPut)
            ConsoleWrite($Sig & @CRLF)
            GUICtrlSetData($PreviewPut, $Med & @CRLF & $Disp & @CRLF & $Sig)
            $Content_PreviewPut = GUICtrlRead($PreviewPut)
            ClipPut($Content_PreviewPut)

    EndSwitch

    ; Read GenericCombo selection
    $sGenericData = GUICtrlRead($MedPut)
    ; If it has changed AND the combo is closed - if we do not check for closure, the code actions while we scan the dropdown list
    If $sGenericData <> $sCurrGenericData And _GUICtrlComboBox_GetDroppedState($MedPut) = False Then
        ; Reset the current text so prevent flicker from constant redrawing
        $sCurrGenericData = $sGenericData
        ; Hide/Show the combos depending on the selection
        Switch $sGenericData
            Case "Rx: Hydrocodone/Acetaminophen 5/500mg"
                _GUICtrlComboBox_SetEditText($DispPut, "Disp: Twelve (12) tabs")
                GUICtrlSetData($SigPut, "Sig: 1 tablet every 6 hours as needed for pain.")

            Case "Rx: Penicillin VK 500mg"
                _GUICtrlComboBox_SetEditText($DispPut, "Disp: Twenty-eight (28) tabs")
                GUICtrlSetData($SigPut, "Sig: 1 tablet PO every 6 hours (QID), until gone.")

            Case "Rx: Clindamycin 150mg"
                _GUICtrlComboBox_SetEditText($DispPut, "Disp: Fifty-six (56)")
                GUICtrlSetData($SigPut, "Sig: 2 tablets PO (QID) until gone.")

            Case "Rx: Acetaminophen 325mg"
                _GUICtrlComboBox_SetEditText($DispPut, "Disp: Twenty-four (24) tabs")
                GUICtrlSetData($SigPut, "Sig: 2-3 tablets every 6 hours as needed for pain.")

            Case "Rx: Ibuprofen 400mg"
                _GUICtrlComboBox_SetEditText($DispPut, "Disp: Forty (40) tabs")
                GUICtrlSetData($SigPut, "Sig: 1 or 2 tablets q6h prn pain.")

            Case "Rx: Tylenol No. 3"
                _GUICtrlComboBox_SetEditText($DispPut, "Disp: Four (4) tabs")
                GUICtrlSetData($SigPut, "Sig: 1 or 2 tablets q6h prn pain.")

            Case "Rx: Chlorhexidine Oral Rinse 0.12%"
                _GUICtrlComboBox_SetEditText($DispPut, "Disp: 1 bottle (473ml)")
                GUICtrlSetData($SigPut, "Sig: 1/2 oz swish for 30 sec bid for 7-14 days")

            Case "Rx: Prevident Rinse (0.2% Neutral NaF)"
                _GUICtrlComboBox_SetEditText($DispPut, "Disp: 1 bottle (473ml)")
                GUICtrlSetData($SigPut, "Sig: 1/2 oz swish three times a week.")

            Case "Rx: Prevident 5000 Plus toothpaste (1.1% NaF)"
                _GUICtrlComboBox_SetEditText($DispPut, "Disp: 1 tube (1.8 oz)")
                GUICtrlSetData($SigPut, "Sig: brush on teeth for two minutes once per day")

            Case "Rx: Amoxicillin 500mg"
                _GUICtrlComboBox_SetEditText($DispPut, "Disp: Four (4) tabs")
                GUICtrlSetData($SigPut, "Sig: 4 tablets 1 hour before tx.")

            Case "Rx: Acetaminophen chewable tablets 80mg"
                _GUICtrlComboBox_SetEditText($DispPut, "Disp: One bottle (30 tabs)")
                GUICtrlSetData($SigPut, "Sig: take as directed on the package (do not exceed 10mg/kg per dose) every 4-6 hours as needed for pain.")

            Case "Rx: Clindamycin oral solution 75mg/5ml"
                _GUICtrlComboBox_SetEditText($DispPut, "Disp:30mg/kg/day")
                GUICtrlSetData($SigPut, "Sig: taken as 4 equal doses per day for 7 days.")

            Case "Rx: Amoxicillin Suspension 250mg/5ml"
                _GUICtrlComboBox_SetEditText($DispPut, "Disp: One bottle (150ml)")
                GUICtrlSetData($SigPut, "Sig: 40mg/kg/day taken as 3 equal doses per day for 10 days.")

        EndSwitch
    EndIf
WEnd

Do ask again if there is anything not right! :lol:

M23

P.S. And I am not liable for anything that this script might do wrong - it is all your responsibility if you decide to use it! :(

Edit: Typnig!

Edited by Melba23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Gumma

Wow thanks a bunch - I can't beleive I missed that SetData command. Really appreciate the time you guys took. Problem solved :mellow:

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  

×