ECCCAZ Posted March 12, 2008 Share Posted March 12, 2008 Please forgive me, I am a PC/Network guy that is lacking in his programming/scripting abilities. I painfully got this code together, and it functions great, but I have tried several different ways to make the cancel button kill the script, and I have had no luck. As of right now, clicking it just acts as the "OK" button. I am probably missing something simple, thanks in advance for taking time to help! CODE: Global $Patient_Last_Name Global $Patient_First_Name Global $Patient_Middle_Inital Global $Patient_YOB Global $Patient_MOB Global $Patient_DOB _first() _second() DirCopy ("C:\Documents and Settings\eric\My Documents\AIT\Template","C:\Documents and Settings\eric\My Documents\AIT\" & $Patient_Last_Name & ", " & $Patient_First_Name & " " & $Patient_YOB & "-" & $Patient_MOB & "-" & $Patient_DOB) Func _first() $Patient_Last_Name = InputBox("Please enter", "Patient Last Name") $Patient_First_Name = InputBox("Please enter", "Patient First Name") $Patient_Middle_Inital = InputBox("Please enter", "Patient Middle Inital") $msg = MsgBox (4, "Is the Patient's name correct?", $Patient_Last_Name & ", " & $Patient_First_Name & "," & $Patient_Middle_Inital) if $msg = 7 Then _first() EndFunc Func _second() $Patient_YOB = InputBox("Please enter", "Patient Year of Birth: 4-Digit") $Patient_MOB = InputBox("Please enter", "Patient Month of Birth: 2-Digit") $Patient_DOB = InputBox("Please enter", "Patient Day of Birth: 2-Digit") $msg=MsgBox (4, "Is the Patient's DOB correct?", $Patient_YOB & "-" & $Patient_MOB & "-" & $Patient_DOB) if $msg = 7 Then _second() EndFunc Link to comment Share on other sites More sharing options...
spudw2k Posted March 12, 2008 Share Posted March 12, 2008 Are you talking about the Cancel button on the input boxes, or the "is this correct" No button? Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
ECCCAZ Posted March 12, 2008 Author Share Posted March 12, 2008 I am talking about the "Cancel" the "NO" button is woking like I need it to. Thanks Eric Link to comment Share on other sites More sharing options...
ECCCAZ Posted March 12, 2008 Author Share Posted March 12, 2008 I am talking about the "Cancel" the "NO" button is woking like I need it to. Thanks Eric Link to comment Share on other sites More sharing options...
spudw2k Posted March 12, 2008 Share Posted March 12, 2008 (edited) Ok, here's how I would do it. For the Inputboxes, check for Blank Return String and Error code of 1 which means canceled. $Patient_Last_Name = InputBox("Please enter", "Patient Last Name") If $Patient_Last_Name = "" And @error = 1 Then Exit Edited March 12, 2008 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
spudw2k Posted March 12, 2008 Share Posted March 12, 2008 Also, you can force data to be entered like this Do $Patient_Last_Name = InputBox("Please enter", "Patient Last Name") Until $Patient_Last_Name <> "" And @Error = 0 Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
ECCCAZ Posted March 12, 2008 Author Share Posted March 12, 2008 Thank you, that worked like a charm. I hear on a daily basis from people that they wish they had my PC knowledge, I know how they feel because I wish I had you coding knowledge! I should have figured that out, thanks so much for the help!! Link to comment Share on other sites More sharing options...
spudw2k Posted March 12, 2008 Share Posted March 12, 2008 No sweat man. We all started wanting to be coders. Some just have more time to dedicate than others. I'm no expert either, but I'm eager to learn and have the drive to solve. Glad to assist. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now