twelo Posted December 14, 2009 Share Posted December 14, 2009 is it possible to include extra .au3 files in middle of script like between case scenario ? because when i added extra .au3 file at the top of script my program goes slow down it takes same extra time for which .au3 included (that means it loads automatically when programs starts) i want extra .au3 to load when give input task. Link to comment Share on other sites More sharing options...
jvanegmond Posted December 14, 2009 Share Posted December 14, 2009 It is possible, but you should never do it. github.com/jvanegmond Link to comment Share on other sites More sharing options...
twelo Posted December 14, 2009 Author Share Posted December 14, 2009 It is possible, but you should never do it.how ? any example, plz clarify Link to comment Share on other sites More sharing options...
jvanegmond Posted December 14, 2009 Share Posted December 14, 2009 How? Simply #include in the middle. Clarify? Don't do it. Your actions must reflect a negative attitude towards including files in the middle of your script. github.com/jvanegmond Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 14, 2009 Moderators Share Posted December 14, 2009 Manadar,While I agree with you 100% when talking about placing UDF #include files in the middle of a script, there is a place for using #include files which merely add a bit of frequently used code. Here is a simple example:Include file:If $i = 0 Then MsgBox(0, "Error", "Count is zero") ExitLoop EndIfMain script:For $i = 5 To 0 Step -1 #include <mb.au3> Next For $i = 5 To 0 Step -1 #include <mb.au3> NextThe only problem I ran across the one time I tried to use this technique was that Au3Check complained that I was trying to include the same file more than once and I could not find how to reset the switch to avoid this.Anyway, just to reiterate for twelo's benefit, I am 100% with you about putting UDF #include files as the beginning of the script. Just do not do it!M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
jvanegmond Posted December 14, 2009 Share Posted December 14, 2009 No, not even for small code snippets. There are work arounds and solutions. I know you posted an example, but you can always do things like this: For $i = 5 To 0 Step -1 If _CheckError($i) Then ExitLoop Next For $i = 5 To 0 Step -1 If _CheckError($i) Then ExitLoop Next Func _CheckError($n) If $n = 0 Then MsgBox(0, "Error", "Count is zero") Return 1 EndIf Return 0 EndFunc Even for 1 liners, you would still have to type #include on each line. It makes your script a pain to maintain. github.com/jvanegmond 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