Sign in to follow this  
Followers 0
Andrew Peacock

Very annoying SciTe behaviour - any fixes?

6 posts in this topic

Hi,

I like to compartmentalise my AutoIt functions, so I have one main script and several included script to handle seperate chunks of behaviour.

And I'd love to be able to tell SciTe: "When I press F5 to run this script, don't run this included script, run the main one instead. Hence bypassing loads of errors about undefined variables because they are actually defined in the main script not the include."

Anyone know a way of doing this?

Regards,

Andy

Share this post


Link to post
Share on other sites



And I'd love to be able to tell SciTe: "When I press F5 to run this script, don't run this included script, run the main one instead. Hence bypassing loads of errors about undefined variables because they are actually defined in the main script not the include."

The #include directive is much, much more basic than you think it is. The compiler literally copies and pastes that other file right smack in place of the #include directive. It then runs the whole thing as if it was one script (because at that point, it is).

If you want to pick and choose what it "looks at" in the #include-ed files, I suggest further splitting up your #include files into parts that get executed, and parts that are just definitions and declarations, so that you can comment and uncomment those #includes separately.

This is a generally good practice, anyway.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hi,

I like to compartmentalise my AutoIt functions, so I have one main script and several included script to handle seperate chunks of behaviour.

And I'd love to be able to tell SciTe: "When I press F5 to run this script, don't run this included script, run the main one instead. Hence bypassing loads of errors about undefined variables because they are actually defined in the main script not the include."

Anyone know a way of doing this?

Regards,

Andy

Honestly, that does not make sense!!

Most of the Includes from Autoit are exceptionally well written. If they are yours, you shouldn't have any $variables declared twice anyways...

But the simple answer, that everyone wants... Just place a ";" in front of the include,

Example...

; #Include <Array.au3>

... The REAL trick is built into SciTe, just click on the line you don't want to use and hit the "-" on the number pad

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

... The REAL trick is built into SciTe, just click on the line you don't want to use and hit the "-" on the number pad

8)

I love that little trick :D

Share this post


Link to post
Share on other sites

Hi,

I like to compartmentalise my AutoIt functions, so I have one main script and several included script to handle seperate chunks of behaviour.

And I'd love to be able to tell SciTe: "When I press F5 to run this script, don't run this included script, run the main one instead. Hence bypassing loads of errors about undefined variables because they are actually defined in the main script not the include."

Anyone know a way of doing this?

Regards,

Andy

I actually think this could be a useful feature and it could be done by defining your own HotKey in Scite.

If I compile a project in C or Delphi for example, then it doesn't matter which file I have open in the editor, it could be an include or some file which is nothing to do with the project, I can hit F9 and compile the project and run it. A common situation is that I am viewing a file produced by the script and I don't want to keep switching between files.

If you look up the way OrganiseIncludes works I think you will be able to work out a way to do what you want.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Hi,

I like to compartmentalise my AutoIt functions, so I have one main script and several included script to handle seperate chunks of behaviour.

And I'd love to be able to tell SciTe: "When I press F5 to run this script, don't run this included script, run the main one instead. Hence bypassing loads of errors about undefined variables because they are actually defined in the main script not the include."

Anyone know a way of doing this?

Regards,

Andy

SciTE doesn't work with projects where you can define the MAIN file to run when F5 is pressed.

You could, when your include files you are working on are project specific and located in the same directory as the master script, create a scite.properties in that project directory and add this line in it (this assumes the full version of SciTE4AutoIt3 is installed):

command.go.$(au3)="$(SciteDefaultHome)\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "$(FileDir)\main.au3" /autoit3dir "$(autoit3dir)" /UserParams $(1) $(2) $(3) $(4)

This will tell SciTE to run Main.au3 when F5 is pressed for any .au3 file opened from this directory.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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