darkxraver Posted February 19, 2009 Share Posted February 19, 2009 heya thx for the answer of my other topic it worked but now im stuck again.. so i now have the inputbox which the user can change and it saves the new value - close and reopen the script and the new value will be shown now i have a new feature where im stuck at: another inputbox where the user can add a value, select from the combobox what element it is, hit the add button and it should add the value of the 2nd inputbox to the 1st inputbox i.e. inputbox1= 637 inputbox2= 378 combobox= Earth addbutton --------------------- inputbox1 + inputbox2 = inputbox1 <-- inputbox1 because it should write the new value in the inputbox1 637 + 378 = 1015 <-- should write the total value to the inputbox1 hope you understand my problem and could help me out thx Link to comment Share on other sites More sharing options...
SpookMeister Posted February 19, 2009 Share Posted February 19, 2009 (edited) Are you talking about in a GUI where you created this input via GUICtrlCreateInput() or are you actually talking about the InputBox() function? or something else entirely... Hard to answer you as I dont know what other thread you mean and you havent posted any code to look at. [edit] typo Edited February 19, 2009 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 More sharing options...
darkxraver Posted February 20, 2009 Author Share Posted February 20, 2009 oh yeah its all via gui so its the GUICtrlCreateInput uhm this is the first inputbox $earth1 = GUICtrlCreateInput($e1ini, 45, 70, 55, 20) this the second inputbox GUICtrlCreateInput("0", 375, 70, 55, 20) this the add button GUICtrlCreateButton("Add", 325, 69,42,20) and this is the combobox GUICtrlCreateCombo("Earth", 440, 70, 55, 15) GUICtrlSetData(-1, "Fire|Water|Wind", "") so yeah what id like it to do is that a user can add a random value into the second inputbox, select earth, fire, water or wind from the dropdown menu, hit the add button and it should add the value of the second inputbox to the first inputbox thx Link to comment Share on other sites More sharing options...
Ascend4nt Posted February 20, 2009 Share Posted February 20, 2009 Cast the string to a number then add. Number($sString1)+Number($sString2) My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs |Â Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) |Â Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
darkxraver Posted February 20, 2009 Author Share Posted February 20, 2009 ugh dun know what you mean x: but if somebody is interrested and could help me out i could send the whole code via pm would really appreciate it thx Link to comment Share on other sites More sharing options...
darkxraver Posted February 20, 2009 Author Share Posted February 20, 2009 (edited) kinda figured it out myself x: but still got 1 little problem..$earth1 = GUICtrlCreateInput($e1ini, 45, 70, 55, 20) $add1 = GUICtrlCreateButton("Add", 325, 69,42,20) $addinput1 = GUICtrlCreateInput("0", 375, 70, 55, 20) $combo1 = GUICtrlCreateCombo("Earth", 440, 70, 55, 15) GUICtrlSetData(-1, "Fire|Water|Wind", "") select Case $nMsg = $add1 $data = GUICtrlRead($addinput1) $data2 = GUICtrlRead($earth1) GUICtrlSetData($earth1, ($data + $data2)) GUICtrlSetData($addinput1, "0") EndSelectthis is what i got so far what happens is i.e.:inputbox1($earth1) = value of 100inputbox2($addinput1) = user enters 5user hits the add button ($add1)it calculates the current value of inputbox1($earth1) and the new inputbox2($addinput1)and enters the new value which is 105 in inputbox1($earth1)and the value of inputbox2($addinput1) becomes "0" againso it works fine xept for that i dont have the $combo1 = GUICtrlCreateCombo("Earth", 440, 70, 55, 15) GUICtrlSetData(-1, "Fire|Water|Wind", "")added.so what it should do is if "Earth" from the combobox is selected which is $combo1 and the user enters a value in inputbox2 which is $addinput and clicks the add button which is $add1 it should calculate the values only for "Earth" from the comboboxheres a screenshot from the interface with a little description Edited February 20, 2009 by darkxraver Link to comment Share on other sites More sharing options...
ukmazy Posted February 20, 2009 Share Posted February 20, 2009 lol silkroad alchemy bot xD u can use switch and case with that Link to comment Share on other sites More sharing options...
darkxraver Posted February 20, 2009 Author Share Posted February 20, 2009 (edited) yeah that i know..$earth1 = GUICtrlCreateInput($e1ini, 45, 70, 55, 20) $add1 = GUICtrlCreateButton("Add", 325, 69,42,20) $addinput1 = GUICtrlCreateInput("0", 375, 70, 55, 20) $combo1 = GUICtrlCreateCombo("Earth", 440, 70, 55, 15) GUICtrlSetData(-1, "Fire|Water|Wind", "") select Case $nMsg = $add1 $data = GUICtrlRead($addinput1) $data2 = GUICtrlRead($earth1) GUICtrlSetData($earth1, ($data + $data2)) GUICtrlSetData($addinput1, "0") EndSelectthis is the code i have so far but theres 1 line im missing that tells it to calculate Earth, Fire, Water or Wind but i cant figure it out..already tried something like$earth1 = GUICtrlCreateInput($e1ini, 45, 70, 55, 20)$add1 = GUICtrlCreateButton("Add", 325, 69,42,20)$addinput1 = GUICtrlCreateInput("0", 375, 70, 55, 20)$combo1 = GUICtrlCreateCombo("Earth", 440, 70, 55, 15) GUICtrlSetData(-1, "Fire|Water|Wind", "")select Case $nMsg = $add1 & $combo1 $data = GUICtrlRead($addinput1) $data2 = GUICtrlRead($earth1) GUICtrlSetData($earth1, ($data + $data2)) GUICtrlSetData($addinput1, "0") EndSelectbut didnt work x: so idk im kinda stuck Edited February 20, 2009 by darkxraver Link to comment Share on other sites More sharing options...
Ascend4nt Posted February 20, 2009 Share Posted February 20, 2009 I suspect there's some sort of language barrier here, as I'm not fully following what you are saying or doing.. but this line: Case $nMsg = $add1 & $combo1 should be: Case $nMsg=$add1 Or $nMsg=$combo1 And this must be cast properly GUICtrlSetData($earth1, ($data + $data2)) to: GUICtrlSetData($earth1, String(Number($data) + Number($data2))) My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs |Â Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) |Â Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
darkxraver Posted February 20, 2009 Author Share Posted February 20, 2009 sry about not beeing clear enough i just changed it to what youve posted still works but as you can see in the picture a few posts above that i posted i have a combobox, inputbox and add button what i want it to do is if i enter a value in the inputbox and select "Fire" from the dropdown menu/combobox menu and click on "add" it should calculate and enter the new calculated value into the fire slot/fire inputbox and if i select water from the dropdown menu/combobox menu and click on "add" it should calculate and enter the new calculated value into the water slot/water inputbox same goes for earth and wind hope i explained it a bit better thx Link to comment Share on other sites More sharing options...
BrettF Posted February 20, 2009 Share Posted February 20, 2009 Does something like this help? Cause its what I thought you wanted. #include <GUIConstantsEx.au3> $Form1 = GUICreate("Form1", 429, 127, 193, 125) $Input1 = GUICtrlCreateInput("", 16, 24, 121, 21) $Label1 = GUICtrlCreateLabel("+", 144, 26, 10, 17) $Input2 = GUICtrlCreateInput("", 160, 24, 121, 21) $Label2 = GUICtrlCreateLabel("=", 288, 26, 10, 17) $Input3 = GUICtrlCreateInput("", 304, 24, 121, 21) $Input4 = GUICtrlCreateInput("", 304, 48, 121, 21) $Input5 = GUICtrlCreateInput("", 304, 72, 121, 21) $Input6 = GUICtrlCreateInput("", 304, 96, 121, 21) $Combo1 = GUICtrlCreateCombo("1", 16, 56, 145, 25) GUICtrlSetData (-1, "2|3|4") $Button1 = GUICtrlCreateButton("Calculate", 168, 50, 123, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $out = GUICtrlRead ($Input1) + GUICtrlRead ($Input2) Switch GUICtrlRead ($Combo1) Case "1" GUICtrlSetData ($Input3, $out) Case "2" GUICtrlSetData ($Input4, $out) Case "3" GUICtrlSetData ($Input5, $out) Case "4" GUICtrlSetData ($Input6, $out) EndSwitch EndSwitch WEnd Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
darkxraver Posted February 20, 2009 Author Share Posted February 20, 2009 (edited) yeah thats what i was looking for now i just need to take a better look at your code and add/change it in my script edit: just noticed that with your code it doesnt store the value in the inputbox after the "=" so i.e. the value of the first inputbox would be 100 and the value of the second inputbox (after the "+") would be 5 the value in the inputbox after the "=" will always be 105 but i need it to stay 105 and if i would enter 10 in the second inputbox (after the "+") it should add the 10 to the 105 :S thx Edited February 20, 2009 by darkxraver Link to comment Share on other sites More sharing options...
Ascend4nt Posted February 20, 2009 Share Posted February 20, 2009 Ahh, good job BrettF, now I understand. darkxraver, you can clear out the 2 add boxes and retain the values by changing this part of the code: Switch GUICtrlRead ($Combo1) Case "1" GUICtrlSetData ($Input3, GUICtrlRead($Input3)+$out) GUICtrlSetData($Input1,"") GUICtrlSetData($Input2,"") Case "2" GUICtrlSetData ($Input4, GUICtrlRead($Input4)+$out) GUICtrlSetData($Input1,"") GUICtrlSetData($Input2,"") Case "3" GUICtrlSetData ($Input5, GUICtrlRead($Input5)+$out) GUICtrlSetData($Input1,"") GUICtrlSetData($Input2,"") Case "4" GUICtrlSetData ($Input6, GUICtrlRead($Input6)+$out) GUICtrlSetData($Input1,"") GUICtrlSetData($Input2,"") EndSwitch Also, you can test if the user entered a valid #.. (otherwise if they enter 1z or somesuch, it will give you a zero for that field). Here's a test for a valid whole # If not StringRegExp(GUICtrlRead($Input1),"\A\d+\z",0) Then ConsoleWrite("NOT A NUMBER!" & @CRLF) My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs |Â Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) |Â Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
BrettF Posted February 20, 2009 Share Posted February 20, 2009 #include <GUIConstantsEx.au3> $Form1 = GUICreate("Form1", 429, 127, 193, 125) $Input1 = GUICtrlCreateInput("", 16, 24, 121, 21) $Label1 = GUICtrlCreateLabel("+", 144, 26, 10, 17) $Input2 = GUICtrlCreateInput("", 160, 24, 121, 21) $Label2 = GUICtrlCreateLabel("=", 288, 26, 10, 17) $Input3 = GUICtrlCreateInput("", 304, 24, 121, 21) $Input4 = GUICtrlCreateInput("", 304, 48, 121, 21) $Input5 = GUICtrlCreateInput("", 304, 72, 121, 21) $Input6 = GUICtrlCreateInput("", 304, 96, 121, 21) $Combo1 = GUICtrlCreateCombo("1", 16, 56, 145, 25) GUICtrlSetData (-1, "2|3|4") $Button1 = GUICtrlCreateButton("Calculate", 168, 50, 123, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $out = GUICtrlRead ($Input1) + GUICtrlRead ($Input2) Switch GUICtrlRead ($Combo1) Case "1" GUICtrlSetData ($Input3, $out + GUICtrlRead ($Input3)) Case "2" GUICtrlSetData ($Input4, $out + GUICtrlRead ($Input4)) Case "3" GUICtrlSetData ($Input5, $out + GUICtrlRead ($Input5)) Case "4" GUICtrlSetData ($Input6, $out + GUICtrlRead ($Input6)) EndSwitch EndSwitch WEnd Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
darkxraver Posted February 20, 2009 Author Share Posted February 20, 2009 (edited) woot woot thank you guys very much its working only question i have is where do i put the code that ascendant posted? If not StringRegExp(GUICtrlRead($Input1),"\A\d+\z",0) Then ConsoleWrite("NOT A NUMBER!" & @CRLF) Edited February 20, 2009 by darkxraver Link to comment Share on other sites More sharing options...
BrettF Posted February 20, 2009 Share Posted February 20, 2009 expandcollapse popup#include <GUIConstantsEx.au3> $Form1 = GUICreate("Form1", 429, 127, 193, 125) $Input1 = GUICtrlCreateInput("", 16, 24, 121, 21) $Label1 = GUICtrlCreateLabel("+", 144, 26, 10, 17) $Input2 = GUICtrlCreateInput("", 160, 24, 121, 21) $Label2 = GUICtrlCreateLabel("=", 288, 26, 10, 17) $Input3 = GUICtrlCreateInput("", 304, 24, 121, 21) $Input4 = GUICtrlCreateInput("", 304, 48, 121, 21) $Input5 = GUICtrlCreateInput("", 304, 72, 121, 21) $Input6 = GUICtrlCreateInput("", 304, 96, 121, 21) $Combo1 = GUICtrlCreateCombo("1", 16, 56, 145, 25) GUICtrlSetData (-1, "2|3|4") $Button1 = GUICtrlCreateButton("Calculate", 168, 50, 123, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $i1 = StringRegExp (GUICtrlRead($Input1), "[0-9]", 0) If $i1 Then $i1 = GUICtrlRead ($Input1) $i2 = StringRegExp (GUICtrlRead($Input1), "[0-9]") If $i2 Then $i2 = GUICtrlRead ($Input2) $out = $i1 + $i2 Switch GUICtrlRead ($Combo1) Case "1" GUICtrlSetData ($Input3, $out + GUICtrlRead ($Input3)) Case "2" GUICtrlSetData ($Input4, $out + GUICtrlRead ($Input4)) Case "3" GUICtrlSetData ($Input5, $out + GUICtrlRead ($Input5)) Case "4" GUICtrlSetData ($Input6, $out + GUICtrlRead ($Input6)) EndSwitch EndSwitch WEnd Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Ascend4nt Posted February 20, 2009 Share Posted February 20, 2009 Boy I guess we're all bored tonight (or tomorrow in Aussie! =) BrettF's test will unfortunately ring true if there are any numbers in the string (rings true for 'asdlkj1sdkj'). Change it to read like mine ("\A\d+\z"), or if you prefer, change his to ("\A[0-9]+\z"), and the test will only ring true for complete # strings. I would also do something like this if it was false (contains non-digits): If Not StringRegExp(GUICtrlRead($Input1),"\A\d+\z",0) MsgBox(48,"Invalid Input Type","Please enter only #'s in the boxe(s) provided") GUICtrlSetData($Input1,"") ContinueLoop Endif My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs |Â Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) |Â Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
BrettF Posted February 20, 2009 Share Posted February 20, 2009 @Ascendant- Are you sure? Here it only accepts something that has 0-9... Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Ascend4nt Posted February 20, 2009 Share Posted February 20, 2009 Brett, yeah because you are only testing for the existence of that group anywhere in the string. By surrounding it with \A (beginning of string) and \z (end of string) and adding + (1 or more occurrences), you ensure that nothing else can be on the line. My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs |Â Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) |Â Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
BrettF Posted February 20, 2009 Share Posted February 20, 2009 I somewhat understand what you are doing, but everything I chuck at that input that is not 0, 1, 2, 3, 4, 5, 6, 7, 8 or 9, it makes it 0, and continues... But that extra checking can't hurt... can it? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! 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