Sign in to follow this  
Followers 0
d0n

SCITE problem

10 posts in this topic

whenever i run my script, SCITE pretty much wants me to global every variable, why does it do this?

I can still run it, I just don't like seeing all the warnings.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

whenever i run my script, SCITE pretty much wants me to global every variable, why does it do this?

I can still run it, I just don't like seeing all the warnings.

SciTE doesn't want anything but when you use SciTe4AutoIt3 then AU3Check is run before running your script with AutoIt3.exe to tell you about syntax errors and possible problems in your script. It is very likely your coding habits that cause au3check to generate the warnings, but you have to give an example to see what really is happening.

Jos

Edited by 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

I ran something like this, and its giving me 2 warnings

E\test.au3(9,33) : WARNING: $Main possibly not declared/created yet

$Main = GUICreate("", 225, 180)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

E:\test.au3(13,20) : WARNING: $msg possibly not declared/created yet

$msg = GUIGetMsg()

~~~~~~~~~~~~~~~~~~^

E:\test.au3 - 0 error(s), 2 warning(s)

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiRichEdit.au3>
#Include <GuiEdit.au3>
#include <SliderConstants.au3>
#include <Array.au3>


$Main = GUICreate("",  225, 180)
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then
        ExitLoop
    EndIf
WEnd

Share this post


Link to post
Share on other sites

You do not get these warnings by default, only when you specified extra parameters for au3check.

Did you show the whole script?


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

yea that is the whole script, maybe i misclicked some F keys on top to turn on something?

Share this post


Link to post
Share on other sites

>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "E:\test.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams

+>17:49:24 Starting AutoIt3Wrapper v.2.0.0.1 Environment(Language:0409 Keyboard:00000409 OS:WIN_XP/Service Pack 2 CPU:X64 OS:X86)

>Running AU3Check (1.54.14.0) from:C:\Program Files\AutoIt3

E:\test.au3(9,33) : WARNING: $Main possibly not declared/created yet

$Main = GUICreate("", 225, 180)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

E:\test.au3(13,20) : WARNING: $msg possibly not declared/created yet

$msg = GUIGetMsg()

~~~~~~~~~~~~~~~~~~^

E:\test.au3 - 0 error(s), 2 warning(s)

->17:49:24 AU3Check ended.rc:1

>Running:(3.3.0.0):C:\Program Files\AutoIt3\autoit3.exe "E:\test.au3"

+>17:49:29 AutoIT3.exe ended.rc:0

+>17:49:30 AutoIt3Wrapper Finished

>Exit code: 0 Time: 8.615

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

It looks like au3check is triggered with the -d parameter or detect an OPT() statement.

do you have this line in one of the used Included files? :

Opt("MustDeclareVars", 1)
Edited by 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

#9 ·  Posted (edited)

yea i found it in GUIRichEdit.au3

Global $_GRE_oldMustDeclareVars = Opt("MustDeclareVars", 1)

Opt("MustDeclareVars", $_GRE_oldMustDeclareVars)

has those 2 lines, so i guess i am stuck with it :)

EDIT: i took it out and it still works :), problem solved, thanks

Edited by d0n

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Opt("MustDeclareVars", 1) is a good thing.

Yuu don't have to use Global, you can use Local but you have to understand the scope when using functions. Local $Main = GUICreate("", 225, 180) would cause no errors in the script shown.

Edited by bo8ster

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

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