billthecreator Posted May 6, 2009 Share Posted May 6, 2009 what is that function called where you can only run one script once... im drawing a blank, and i cant find the right keywords to search the forum with.... [font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap Link to comment Share on other sites More sharing options...
Authenticity Posted May 6, 2009 Share Posted May 6, 2009 _Singleton()? Link to comment Share on other sites More sharing options...
billthecreator Posted May 6, 2009 Author Share Posted May 6, 2009 _Singleton()?YES!Thank you [font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap Link to comment Share on other sites More sharing options...
MilesAhead Posted May 26, 2009 Share Posted May 26, 2009 (edited) _Singleton()? I get a baffling error dialog with _Singleton() I'm trying to use a GUID in my application for unique identifier. I know it works with system mutex because I have components in other languages that have used it for years. Anyway, it works as expected in this code ; Script Start - Add your code below here #include <Misc.au3> Const $ERROR_ALREADY_EXISTS = 183 If _Singleton("{5788CDF6-1E46-41CB-88D1-E27006A8B69A}",1) = 0 Then iF @error = $ERROR_ALREADY_EXISTS Then Exit EndIf While 1 WEnd But if I try to use the same code with a different GUID in a real app, launching the second instance gives me an error dialog "-1 variable used without being declared" instead of quitting quietly Pretty strange. I even move the #include <Misc.au3> and the _Singleton statement way up to the top of the script to avoid interaction with other includes. No joy. Same thing. -1 without being declared yadda yadda Edit: I figured it out. It was due to OnAutoItExit() accessing variables that were never made because the script quits. Edited May 26, 2009 by MilesAhead My Freeware Page Link to comment Share on other sites More sharing options...
Authenticity Posted May 26, 2009 Share Posted May 26, 2009 Did you define $ERROR_ALREADY_EXIST in the other script? Try to run it from SciTE and see what crashing the script and where. 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