Jump to content

Bug? About _Singleton()


Recommended Posts

#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

#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?
Link to comment
Share on other sites

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.

Edited by Bert
Link to comment
Share on other sites

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

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 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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...