Jump to content

Can't Exit While Loop


AndrewG
 Share

Recommended Posts

Hello everyone,

I have a GUI with two buttons; a play button and a stop button. Basicly what happens is When the play button is pressed a while loop is started and a number counter starts. When the stop button is pressed the loop is suppose to exit but I can't get it to exit. I can't see what's wrong, Would somebody help me with this.

Thanks for your time.

#include <GUIConstants.au3>

Opt("MustDeclareVars", 1)

Global $frmMain, $g_btnPlay, $g_btnStop, $sMessage, $msg
Global $i_isPlay = 0
Global $i_Count = 1
    $frmMain = GUICreate("Learning Looping", 800, 400, (@DesktopWidth - 800)/2, (@DesktopHeight - 400)/2,-1,-1)

;Master Play Controls
    $g_btnPlay = GUICtrlCreateButton("Play", 10, 360, 40, 30, -1, -1)
    $g_btnStop = GUICtrlCreateButton("Stop", 50, 360, 40, 30, -1, -1)
    
;Messages
    GUICtrlCreateGroup("Messages", 450, 180, 220, 140, -1, -1)
        $sMessage = GUICtrlCreateLabel("", 460, 200, 200, 100, -1, -1)
    GUICtrlCreateGroup("", -99, -99, 1,1);Close group
    
    GUISetState(@SW_SHOW)

    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $g_btnPlay
                btnPlay()
            Case $msg = $g_btnStop
                btnStop()
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
        EndSelect
    WEnd 



;Play Function
    Func btnPlay()
        If $i_isPlay == 0 Then
            $i_isPlay = 1
            GUICtrlSetData($sMessage, $i_isPlay)
            PlayLoop()
        ElseIf $i_isPlay == 1 Then
            Return
        Else
            Return
        EndIf
            
    EndFunc


;Stop Function
    Func btnStop()
        If $i_isPlay == 1 Then
            $i_isPlay = 0
            GUICtrlSetData($sMessage, $i_isPlay)
            PlayLoop()
        ElseIf $i_isPlay == 0 Then
            Return
        Else
            Return
        EndIf
            
    EndFunc

;Loop function
    Func PlayLoop()
        While $i_isPlay == 1
            $i_Count = $i_Count + 1
            GUICtrlSetData($sMessage, $i_isPlay & @CRLF & " Looping" & @CRLF & $i_Count)
        If $i_isPlay == 0 Then
            GUICtrlSetData($sMessage, $i_isPlay & " Stoping")
            ExitLoop
        EndIf
        WEnd
    EndFunc
Link to comment
Share on other sites

well you need to poll for the stop button in the loop your currently in so :-

#include <GUIConstants.au3>

Opt("MustDeclareVars", 1)

Global $frmMain, $g_btnPlay, $g_btnStop, $sMessage, $msg
Global $i_isPlay = 0
Global $i_Count = 1
$frmMain = GUICreate("Learning Looping", 800, 400, (@DesktopWidth - 800) / 2, (@DesktopHeight - 400) / 2, -1, -1)

;Master Play Controls
$g_btnPlay = GUICtrlCreateButton("Play", 10, 360, 40, 30, -1, -1)
$g_btnStop = GUICtrlCreateButton("Stop", 50, 360, 40, 30, -1, -1)

;Messages
GUICtrlCreateGroup("Messages", 450, 180, 220, 140, -1, -1)
$sMessage = GUICtrlCreateLabel("", 460, 200, 200, 100, -1, -1)
GUICtrlCreateGroup("", -99, -99, 1, 1);Close group

GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $g_btnPlay
            btnPlay()
        Case $msg = $g_btnStop
            btnStop()
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEnd



;Play Function
Func btnPlay()
    If $i_isPlay == 0 Then
        $i_isPlay = 1
        GUICtrlSetData($sMessage, $i_isPlay)
        PlayLoop()
    ElseIf $i_isPlay == 1 Then
        Return
    Else
        Return
    EndIf

EndFunc   ;==>btnPlay


;Stop Function
Func btnStop()
    If $i_isPlay == 1 Then
        $i_isPlay = 0
        GUICtrlSetData($sMessage, $i_isPlay)
        PlayLoop()
    ElseIf $i_isPlay == 0 Then
        Return
    Else
        Return
    EndIf

EndFunc   ;==>btnStop

;Loop function
Func PlayLoop()
    While $i_isPlay == 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $g_btnStop
                btnStop()
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
        EndSelect
        $i_Count = $i_Count + 1
        GUICtrlSetData($sMessage, $i_isPlay & @CRLF & " Looping" & @CRLF & $i_Count)
        If $i_isPlay == 0 Then
            GUICtrlSetData($sMessage, $i_isPlay & " Stoping")
            ExitLoop
        EndIf
    WEnd
EndFunc   ;==>PlayLoop

Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

Link to comment
Share on other sites

While you are trapped in the While/WEnd loop of PlayLoop(), the GUI message loop is not running, so button hits are not detected. You might want to learn event mode instead of message loops for your GUIs.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

yea your right but the problem with GUIOnEventMode", 1 is that it dont receive events again until you have returned from the func called from a previous event, so in his case while its in the "playloop" func he would have to manually poll for the stop button anyhow!

This is the main reason why iv never really used this method.

Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

Link to comment
Share on other sites

well you need to poll for the stop button in the loop your currently in so :-

#include <GUIConstants.au3>

Opt("MustDeclareVars", 1)

Global $frmMain, $g_btnPlay, $g_btnStop, $sMessage, $msg
Global $i_isPlay = 0
Global $i_Count = 1
$frmMain = GUICreate("Learning Looping", 800, 400, (@DesktopWidth - 800) / 2, (@DesktopHeight - 400) / 2, -1, -1)

;Master Play Controls
$g_btnPlay = GUICtrlCreateButton("Play", 10, 360, 40, 30, -1, -1)
$g_btnStop = GUICtrlCreateButton("Stop", 50, 360, 40, 30, -1, -1)

;Messages
GUICtrlCreateGroup("Messages", 450, 180, 220, 140, -1, -1)
$sMessage = GUICtrlCreateLabel("", 460, 200, 200, 100, -1, -1)
GUICtrlCreateGroup("", -99, -99, 1, 1);Close group

GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $g_btnPlay
            btnPlay()
        Case $msg = $g_btnStop
            btnStop()
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEnd



;Play Function
Func btnPlay()
    If $i_isPlay == 0 Then
        $i_isPlay = 1
        GUICtrlSetData($sMessage, $i_isPlay)
        PlayLoop()
    ElseIf $i_isPlay == 1 Then
        Return
    Else
        Return
    EndIf

EndFunc   ;==>btnPlay


;Stop Function
Func btnStop()
    If $i_isPlay == 1 Then
        $i_isPlay = 0
        GUICtrlSetData($sMessage, $i_isPlay)
        PlayLoop()
    ElseIf $i_isPlay == 0 Then
        Return
    Else
        Return
    EndIf

EndFunc   ;==>btnStop

;Loop function
Func PlayLoop()
    While $i_isPlay == 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $g_btnStop
                btnStop()
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
        EndSelect
        $i_Count = $i_Count + 1
        GUICtrlSetData($sMessage, $i_isPlay & @CRLF & " Looping" & @CRLF & $i_Count)
        If $i_isPlay == 0 Then
            GUICtrlSetData($sMessage, $i_isPlay & " Stoping")
            ExitLoop
        EndIf
    WEnd
EndFunc   ;==>PlayLoop

Thank you very much for the answer.

Link to comment
Share on other sites

yea your right but the problem with GUIOnEventMode", 1 is that it dont receive events again until you have returned from the func called from a previous event, so in his case while its in the "playloop" func he would have to manually poll for the stop button anyhow!

This is the main reason why iv never really used this method.

Which method are you referring to? The GUIOnEventMode, 1 or the way I have written my script?

Link to comment
Share on other sites

yea your right but the problem with GUIOnEventMode", 1 is that it dont receive events again until you have returned from the func called from a previous event, so in his case while its in the "playloop" func he would have to manually poll for the stop button anyhow!

This is the main reason why iv never really used this method.

That's a stupid argument, that is easily fixed by letting the play button set a global variable and then return the script. The variable is then checked in the main-loop and if it is True it does something. Since you aren't processing any event the click on STOP would be ran directly and you could then set the flag to False.

It's not any harder than using GUIGetMsg(). OnEvent Mode is actually better since it wouldn't force "sleeps" everywhere, slowing down your script where you don't want to.

Edited by AdmiralAlkex
Link to comment
Share on other sites

That's a stupid argument, that is easily fixed by letting the play button set a global variable and then return the script. The variable is then checked in the main-loop and if it is True it does something. Since you aren't processing any event the click on STOP would be ran directly and you could then set the flag to False.

yea i understand , but im just saying my point of view, it's fine here except he would have to rearrange his script (not a problem here) but iv found that using event mode 1 forces you to have all you "workings" inside 1 "main" loop. I mean you can shoot out from your main loop to change a flag, setup a gui, do some calculation etc etc that's fine as long as you don't intend to hang around inside any called functions. Personally I like to have separate parts to a program in separate functions, if 1 main loop contains all the workings for the whole program it gets a bit congested.

Anyhow its just my opinion, some situations lend themselves to eventmode 1 and other dont.

Each to his/her own :)

Edited by JackDinn

Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

Link to comment
Share on other sites

Thanks JackDinn and others for the help so far. Originally I was working with Opt("GUIOnEventMode", 1) but after reading the Autoit help My understanding became that the function that stated the loop was not returning to the gui so there was no way the stop function was going to be called. So I tried the Mesage-loop mode.

Now I tried to exit the while loop in Opt("GUIOnEventMode", 1) as suggested by the other poster but ended up not being able to get it to work.

My understanding at this point is that in order to call the btnStop function while the While loop is executing. I would have to capture the control-ID for stop button. Then compare the captured control-Id with the one stored in the variable holding the control-Id for the control that was clicked when the control was created at run time. If that was eveluated to true then the stop function would be called and the $i_isPlay flag variable value would change. So the while loop should exit. It's not happening. The brain I have been given just doesn't see what is wrong. I understand the Message-loop mode solution now that I see it. I need someone to explain what is wrong in my code useing the On event mode to me.

Would somebody help me out?

Thank you for your time.

#include <GUIConstants.au3>

;Loop Not working


Opt("MustDeclareVars", 1)
Opt("GUIOnEventMode", 1)

Global $frmMain, $g_btnPlay, $g_btnStop, $sMessage, $i_CtrlID
Global $i_isPlay = 0
Global $i_Count = 1

    $frmMain = GUICreate("Learning Looping", 800, 400, (@DesktopWidth - 800)/2, (@DesktopHeight - 400)/2,-1,-1)
        GUISetOnEvent($GUI_EVENT_CLOSE,"ExitApp")
;Master Play Controls
    $g_btnPlay = GUICtrlCreateButton("Play", 10, 360, 40, 30, -1, -1)
        GUICtrlSetOnEvent($g_btnPlay, "btnPlay")
    $g_btnStop = GUICtrlCreateButton("Stop", 50, 360, 40, 30, -1, -1)
        GUICtrlSetOnEvent($g_btnStop, "btnStop")
    
;Messages
    GUICtrlCreateGroup("Messages", 450, 180, 220, 140, -1, -1)
        $sMessage = GUICtrlCreateLabel("", 460, 200, 200, 100, -1, -1)
    GUICtrlCreateGroup("", -99, -99, 1,1);Close group
    
    GUISetState(@SW_SHOW)
    
    

    While 1
        sleep(1000)
    WEnd
    
    
    
    Func ExitApp()
            Exit
    EndFunc



;Play Function
    Func btnPlay()
        If $i_isPlay == 0 Then
            $i_isPlay = 1
            GUICtrlSetData($sMessage, $i_isPlay)
            PlayLoop()
        ElseIf $i_isPlay == 1 Then
            Return
        Else
            Return
        EndIf
            
    EndFunc


;Stop Function
    Func btnStop()
        If $i_isPlay == 1 Then
            $i_isPlay = 0
            GUICtrlSetData($sMessage, $i_isPlay)
            PlayLoop()
        ElseIf $i_isPlay == 0 Then
            Return
        Else
            Return
        EndIf
            
    EndFunc

;Loop function
    Func PlayLoop()
        
        While $i_isPlay == 1
            
            $i_CtrlID = @GUI_CTRLID
            ;$i_CtrlID = GUIGetMsg()
            If $i_CtrlID = $g_btnStop Then
                btnStop()
            EndIf

#cs 
;#############################################################          
;Poll GUIGetMsg for stop button. 
;This Solution: for Message-loop Mode version of script
            $msg = GUIGetMsg()
            Select
            Case $msg = $g_btnStop
                btnStop()
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
        EndSelect
;#############################################################

#ce
            $i_Count = $i_Count + 1
            GUICtrlSetData($sMessage, $i_isPlay & @CRLF & " Looping" & @CRLF & $i_Count)
        If $i_isPlay == 0 Then
            GUICtrlSetData($sMessage, $i_isPlay & " Stoping")
            ExitLoop
        EndIf
        WEnd
    EndFunc
Edited by AndrewG
Link to comment
Share on other sites

  • Moderators

AndrewG,

I have simplified your code quite a bit and added a fair few comments to explain why. I hope you can follow:

#include <GUIConstants.au3>

Opt("MustDeclareVars", 1)
Opt("GUIOnEventMode", 1)

Global $frmMain, $g_btnPlay, $g_btnStop, $sMessage, $i_CtrlID = 0
Global $i_isPlay = False ; Makes it easier to toggle between True/False
Global $i_Count = 1

$frmMain = GUICreate("Learning Looping", 800, 400, (@DesktopWidth - 800) / 2, (@DesktopHeight - 400) / 2) ; Not needed if only Default ,-1,-1)
GUISetOnEvent($GUI_EVENT_CLOSE, "ExitApp")
;Master Play Controls
$g_btnPlay = GUICtrlCreateButton("Play", 10, 360, 40, 30) ; Not needed if only Default , -1, -1)
GUICtrlSetOnEvent($g_btnPlay, "btnPlay")
$g_btnStop = GUICtrlCreateButton("Stop", 50, 360, 40, 30) ; Not needed if only Default , -1, -1)
GUICtrlSetOnEvent($g_btnStop, "btnStop")

;Messages
GUICtrlCreateGroup("Messages", 450, 180, 220, 140) ; Not needed if only Default , -1, -1)
$sMessage = GUICtrlCreateLabel("", 460, 200, 200, 100) ; Not needed if only Default , -1, -1)
GUICtrlCreateGroup("", -99, -99, 1, 1);Close group

GUISetState(@SW_SHOW)

While 1
    Playloop() ; See if we need to play
WEnd

Func ExitApp()
    Exit
EndFunc   ;==>ExitApp

;Play Function
Func btnPlay()

    $i_CtrlID = @GUI_CtrlId ; Save the ID of the button as a flag for Playloop()
    If $i_isPlay = False Then  ; == 0 Then  == is only for comparing case sensitive strings
        $i_isPlay = Not $i_isPlay ; Told you it is was easier!
        GUICtrlSetData($sMessage, $i_isPlay)
    ;ElseIf $i_isPlay == 1 Then   Not needed as $i_IsPlay can only be True/False
    ;        Return
    Else
        Return
    EndIf

EndFunc   ;==>btnPlay

;Stop Function  - see above for explanation of changes
Func btnStop()

    $i_CtrlID = @GUI_CtrlId
    If $i_isPlay = True Then
        $i_isPlay = Not $i_isPlay
    Else
        Return
    EndIf

EndFunc   ;==>btnStop

;Loop function
Func PlayLoop()

    While $i_isPlay = 1  ; Again no need for ==
        ; We only get here is the play button was pressed
        $i_Count = $i_Count + 1
        GUICtrlSetData($sMessage, $i_isPlay & @CRLF & " Looping" & @CRLF & $i_Count)
        Sleep(500) ; Just so you can see what is going on in the label - my old eyes cannot cope with anything less
    WEnd
    ; We can get here if the stop button was pressed or if the ButtonID has been reset to 0
    ; So if we do not check we get flickering in the label - try removing the If...Then part and see!
    If $i_CtrlId = $g_btnStop Then GUICtrlSetData($sMessage, $i_isPlay & @CRLF & "Stopping")
    ; Reset the buttonID so we do not fire anything when we loop next time
    $i_CtrlID = 0
EndFunc   ;==>PlayLoop

Although I can see what you were trying to do, I am a great believer in the KISS* principle and you, in my opinion, were getting a bit over-complicated. Not that you were wrong to try and do it another way - when I code I always think of Kipling: "There are nine and sixty ways of constructing tribal lays, and every single one of them is right!" :)

Please ask if anything is unclear.

M23

* Keep It Simple Stupid

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

Fubarable,

Mat has it exactly. The OP's code read (for example):

$g_btnPlay = GUICtrlCreateButton("Play", 10, 360, 40, 30, -1, -1)

The final 2 parameters are merely setting the Style and Extended_Style to the default values and are not really needed. As I was simplifying the code as much as I could, I took the opportunity to point this out by ending the line where it could by inserting a ";" and a comment - leaving the unneccesary code at the end of the line:

$g_btnPlay = GUICtrlCreateButton("Play", 10, 360, 40, 30) ; Not needed if only Default , -1, -1)

As a general rule, anything you can do to reduce the code size is repaid in the reduced size of an eventual compiled exe

Look Mat - he prefers lines like this:

_WinAPI_SetWindowLong($hExplorer, $GWL_STYLE, -1064828928)

to this:

_WinAPI_SetWindowLong($hExplorer, $GWL_STYLE, BitOr($WS_POPUP, $WS_CHILD, $WS_BORDER))

It is all a matter of personal preference. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Look Mat - he prefers lines like this:

_WinAPI_SetWindowLong($hExplorer, $GWL_STYLE, -1064828928)

to this:

_WinAPI_SetWindowLong($hExplorer, $GWL_STYLE, BitOr($WS_POPUP, $WS_CHILD, $WS_BORDER))

It is all a matter of personal preference. :)

M23

That not only saves on the line length, but also an include, I have just released my next project, which is 3000+ lines, and uses 10 different GUI's. The only includes are _SendMessage.Au3 and Array.au3, both I am only using 1 function from. (Which reminds me, I'm going to copy those into my code too.)

Includes will very often double the length of your code and declare a lot more variables than you can imagine. To hell with readability, its a program and I am the sole developer.

UDF's are a different story, I do try and make those readable.

Mat

Edit: probably not the best thing to be teaching people new to AutoIt to do is it ;)

Edit 2:And yet...

I am sure you can see how this makes reading the thread much easier - and saves on server space

Edited by Mat
Link to comment
Share on other sites

Yea sorry i know we are hijacking this thread a little :) but iv often wondered if there is a method/app to pick out the "used" func's & constants from your #includes and put them into your script ? so then you can get rid of a lot of the extras that get included in your script when you use an #include. (as mentioned above)

i have seen Obfuscator but i kinda get put off as soon as i see the comment that goes something like "Using Obfuscator will make your script very difficult to read!" and im not even sure if thats what its for.

Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

Link to comment
Share on other sites

  • Moderators

Mat,

To carry on with the advanced tutorial now that we have started :) - do you use the /SO option with Obfuscator? That strips all the unused constants and functions from any includes and seriously reduces the size of your final exe/au3. Jos has done a wonderful job with it and I find it can save as much as half the size of a script.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

jackDinn,

I have just seen your post.

Obfuscator can make your script difficult to read - but it all depends on the parameters you set. You can read all about it from within SciTE via the <Help - SciTE Help> menu. There are a whole range of switches which allow you to shrink your script, make it difficult to read, etc. But you still keep your original script unchanged whenever you use it - it is only the compiler that has to deal with the Obfuscated version.

Do try it and see, It is a real boon to the AutoIt community - and no I am not being paid by Jos to say that! :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Developers

i have seen Obfuscator but i kinda get put off as soon as i see the comment that goes something like "Using Obfuscator will make your script very difficult to read!" and im not even sure if thats what its for.

Yea, well the original intent of Obfuscators was to .... Obfuscate the script to make it hard to read and thus harder to change by others.

I added the /StripOnly type functionally later to it as Obfuscator had all the needed information available to know whether Variables/Functions were used somewhere in the script and didn't want to make it a separate spin-off program.

:)

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

Do try it and see, It is a real boon to the AutoIt community - and no I am not being paid by Jos to say that! ;)

Sure you do... I pay you 5% each month of what I get. :)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

LOL, looks like you will be getting another 5% shortly then, if all goes well as im going to go have another good hard look at Obfuscator and this time get past the "makes your script hard to read" bit :)

Cheers chaps.

Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

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