Sign in to follow this  
Followers 0
FenyX

Using '_Singleton' function in compiled script

4 posts in this topic

I'm wondering two things about _Singleton and the way it works in a compiled script.

#include <Misc.au3>
If _Singleton("test", 1) = 0 Then ;If test is compiled do I have to write _Singleton("test.exe", 1) instead?
    MsgBox(0, "Warning", "An occurence of test is already running")
    Exit
EndIf
MsgBox(0, "OK", "the first occurence of test is running")

At first in the above example I'ld like to know how to name my 'test' script when it will be compiled. Do I have to add the EXE file extension at the end of the script name ? It seems to be not clearly explained in the help file, or at least I didn't find the info.

Then I'ld like to know what's the first line action in a compiled script. Does the #include function add the whole code lines from the included AU3 script to the current script before compiling? This is how I understand it but I'm maybe wrong so I'ld like to confirm it from experienced peoples.

At last, could you please tell me if there's a place in the AutoIt community websites where I could post my entire script to share the ideas in it and to also allow other AutoIt coders to review the script? It's my first AutoIt complicate script (at least from a newbie point-of-view) and I'm near sure that some things I've made complicate could be done a more simple way. That's why I surely need some advices to progress in my AutoIt skills learning.

Share this post


Link to post
Share on other sites



The first parameter for _Singleton is just a string. No need to rename it when the script is compiled. _Singleton works the same way if you run the script from SciTE or a compiled exe.

1 person likes this

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

At last, could you please tell me if there's a place in the AutoIt community websites where I could post my entire script to share the ideas in it and to also allow other AutoIt coders to review the script? It's my first AutoIt complicate script (at least from a newbie point-of-view) and I'm near sure that some things I've made complicate could be done a more simple way. That's why I surely need some advices to progress in my AutoIt skills learning.

 

You can post in this section and ask for review in the title ( like Please review - "My Script goal" ), and when is finished/working maybe in the Example's section if you think your script is a "cool script"

Edited by Terenz
1 person likes this

Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Share this post


Link to post
Share on other sites

Thanks a lot to you both for having answered so fast.  :)

:ILA2:

Share this post


Link to post
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
Sign in to follow this  
Followers 0