chenxu Posted July 19, 2008 Share Posted July 19, 2008 #include "Misc.au3" if _Singleton("test\test",1) = 0 Then Msgbox(0,"Warning","An occurence of test is already running") Exit EndIf Msgbox(0,"OK","the first occurence of test is running") this is the script copied from AutoIt help file. the version is v3.2.12.0 acording to the help file. I run the script for the first time and it still clain the warning box: Msgbox(0,"Warning","An occurence of test is already running"), why? is this a bug? Link to comment Share on other sites More sharing options...
BrettF Posted July 19, 2008 Share Posted July 19, 2008 #include "Misc.au3" if _Singleton("test\test",1) = 0 Then Msgbox(0,"Warning","An occurence of test is already running") Exit EndIf Msgbox(0,"OK","the first occurence of test is running") this is the script copied from AutoIt help file. the version is v3.2.12.0 acording to the help file. I run the script for the first time and it still clain the warning box: Msgbox(0,"Warning","An occurence of test is already running"), why? is this a bug?Not bugged. Tested on my machine, all Ok here! Are you running it from SciTe or just from the file? 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...
chenxu Posted July 19, 2008 Author Share Posted July 19, 2008 Not bugged. Tested on my machine, all Ok here! Are you running it from SciTe or just from the file?I compiled to exe and run the exe file Link to comment Share on other sites More sharing options...
BrettF Posted July 19, 2008 Share Posted July 19, 2008 I compiled to exe and run the exe fileWhats the .exe called? 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...
picaxe Posted July 19, 2008 Share Posted July 19, 2008 I like to use the scriptname macro If _Singleton(@ScriptName, 1) = 0 Then Msgbox(0,"Warning","An occurence of test is already running") Exit EndIf Msgbox(0,"OK","the first occurence of " & @ScriptName & " is running") Link to comment Share on other sites More sharing options...
Richard Robertson Posted July 19, 2008 Share Posted July 19, 2008 I think I remember seeing something about that example being bugged. Something about / being invalid in the parameter..? Link to comment Share on other sites More sharing options...
BrettF Posted July 19, 2008 Share Posted July 19, 2008 (edited) Intresting, I realised i was running V3.2.10.0 (I think that was it) so I updated, and it didn't work. And reading the documentation in Misc.au3 I can see:String to identify the occurrence of the script. This string may not contain any \ characters unless you are placing the object in a namespace.EDIT:http://svn.autoitscript.com/trac/ticket/316It's set for the next release. Edited July 19, 2008 by Bert 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...
chenxu Posted July 19, 2008 Author Share Posted July 19, 2008 Intresting, I realised i was running V3.2.10.0 (I think that was it) so I updated, and it didn't work. And reading the documentation in Misc.au3 I can see: String to identify the occurrence of the script. This string may not contain any \ characters unless you are placing the object in a namespace. EDIT: http://svn.autoitscript.com/trac/ticket/316 It's set for the next release.Thank you, I remove the / char from the $sOccurenceName variable and it works now, I think use @ScriptName is a good choice. Link to comment Share on other sites More sharing options...
ProgAndy Posted July 19, 2008 Share Posted July 19, 2008 (edited) Thank you, I remove the / char from the $sOccurenceName variable and it works now, I think use @ScriptName is a good choice.Dont't thinks so. Just rename the Script and you can run it more than once muttley I suppose to use a GUID which is quite unique Edited July 19, 2008 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes 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