Ascend4nt Posted February 20, 2009 Share Posted February 20, 2009 (edited) You know why it's giving you 0 for a return? It gives you zero when you read an input with anything other than #'s in it. So the regular expression in your example really is the same as reading the control without any checks. That's why you aren't seeing it. You should get the String Regular Expression Tester to test out the results of different strings, that tool's helped me a lot .In any case, I just thought it would be a good idea to tell the user that their string is invalid rather than treating it as 0.. but either way is good*edit: I should add, it sets it to 0 when used in an algebraic expression, like using + or * (otherwise it maintains itself as a string) Edited February 20, 2009 by ascendant 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 kinda off topic but still has to do something with my script.. like in the screenshot on page 1 i have these pics on the top that show the elements the code for them to display looks like this GUICtrlCreatePic(@DesktopDir & "\SRO]v[ o ])\Elements\archemy_element_earth.jpg", 57, 20, 32, 32) GUICtrlCreatePic(@DesktopDir & "\SRO]v[ o ])\Elements\archemy_element_fire.jpg", 127, 20, 32, 32) GUICtrlCreatePic(@DesktopDir & "\SRO]v[ o ])\Elements\archemy_element_water.jpg", 197, 20, 32, 32) GUICtrlCreatePic(@DesktopDir & "\SRO]v[ o ])\Elements\archemy_element_wind.jpg", 267, 20, 32, 32) so i was wondering if i would send somebody a .rar file that contains my script folder with the images and he runs my script then the pictures wont display if im right or? and if they wont display.. how can i make it that it will display no matter in what folder they copy the files? thx Link to comment Share on other sites More sharing options...
jvanegmond Posted February 20, 2009 Share Posted February 20, 2009 Use a relative uri.. if your script is in @DesktopDir & "\SRO]v[ o ])\ then this should be the code: GUICtrlCreatePic("Elements\archemy_element_earth.jpg", 57, 20, 32, 32) GUICtrlCreatePic("Elements\archemy_element_fire.jpg", 127, 20, 32, 32) GUICtrlCreatePic("Elements\archemy_element_water.jpg", 197, 20, 32, 32) GUICtrlCreatePic("Elements\archemy_element_wind.jpg", 267, 20, 32, 32) github.com/jvanegmond Link to comment Share on other sites More sharing options...
darkxraver Posted February 20, 2009 Author Share Posted February 20, 2009 (edited) but if id send you the script in a .rar file lets say folder name "images" in this folder there are the images script.exe and you would extract both the folder and the script lets say to C:\Program Files\TestScript\ then it wont be the desktop anymore or? cause some users would extract it maybe to their desktop, some would extract it to C:\Program Files maybe even some to D:\ so idk 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 You know why it's giving you 0 for a return? It gives you zero when you read an input with anything other than #'s in it. So the regular expression in your example really is the same as reading the control without any checks. That's why you aren't seeing it. You should get the String Regular Expression Tester to test out the results of different strings, that tool's helped me a lot .In any case, I just thought it would be a good idea to tell the user that their string is invalid rather than treating it as 0.. but either way is good*edit: I should add, it sets it to 0 when used in an algebraic expression, like using + or * (otherwise it maintains itself as a string)Thats the way I designed it though @darkxraver- try @scriptdir & "\images\......" 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 ugh thx.. should have looked at the help file :S while were at it is there a way to display the users how many ppl already use the program/script ? ive seen a program that shows something like "Users: xxxx" in the title bar but im not sure if it was coded with autoit i think if a users runs the program/script it saves their mac or something Link to comment Share on other sites More sharing options...
jvanegmond Posted February 20, 2009 Share Posted February 20, 2009 but if id send you the script in a .rar file lets sayfolder name "images" in this folder there are the imagesscript.exeand you would extract both the folder and the script lets say to C:\Program Files\TestScript\then it wont be the desktop anymore or?cause some users would extract it maybe to their desktop, some would extract it to C:\Program Files maybe even some to D:\so idkIt is relative. Relative file names are a concept from the DOS age and possibly earlier, I'm surprised you don't understand them by now.For example your script is in:D:\asjkdhajksd\myscript.au3D:\asjkdhajksd\myscript.exethen it would look for the images in:D:\asjkdhajksd\Elements\archemy_element_earth.jpgetc. github.com/jvanegmond Link to comment Share on other sites More sharing options...
darkxraver Posted February 20, 2009 Author Share Posted February 20, 2009 @BrettF and ascendant with the thingy that only allows to input numbers in the inputbox.. i just found out that you could use the code $ES_NUMBER i.e $addinput1 = GUICtrlCreateInput("0", 375, 70, 55, 20,$ES_NUMBER) it will block any other inputs than 0-9 Link to comment Share on other sites More sharing options...
BrettF Posted February 20, 2009 Share Posted February 20, 2009 Heck! How did I forget that! 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 @BrettF and ascendant with the thingy that only allows to input numbers in the inputbox.. i just found out that you could use the code $ES_NUMBER i.e $addinput1 = GUICtrlCreateInput("0", 375, 70, 55, 20,$ES_NUMBER) it will block any other inputs than 0-9 haha u skooled us 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...
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