Jump to content
tylo

Au3Check.exe

Recommended Posts

Hi Tylo,

I am trying to use your program with my prefered editor, PSPad, and to let it capture the output of your program I tried to redirect the output to a log file by using the ">" operator. However this does not seem to work as what your program puts in the file is not what it prints in the command window. Is there a way to solve this issue?

Cheers,

Angel

<{POST_SNAPBACK}>

Try using :

au3check  script.au3 > file.log 2>&1

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

Share this post


Link to post
Share on other sites

Thanks JdeB. This solves the problem on the command line, but it still does not work with my editor. I've to check if I am setting it up incorrectly.

By the way, can you explain me what does your solution do? I don't understand the 2>&1 bit.

Cheers,

Angel

Share this post


Link to post
Share on other sites

Thanks JdeB. This solves the problem on the command line, but it still does not work with my editor. I've to check if I am setting it up incorrectly.

By the way, can you explain me what does your solution do? I don't understand the 2>&1 bit.

Cheers,

Angel

<{POST_SNAPBACK}>

> is STDOUT

2> is STDERR

2>&1 means pipe the STDERR to the STDOUT pipe.


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

Share this post


Link to post
Share on other sites

Version v1.11

Quite a few updates.

- added check for first string parameter Opt/ControlSendCommand/Mouse*

- improved error message for block structures missing closing keyword (if/select/while...)

- prints all output to stdout - not to stderr anymore

- prints number of errors/warning as summery.

- updated .def file.

Download in first post - will update that post later.

Have a nice weekend.

Share this post


Link to post
Share on other sites

Version v1.11

Quite a few updates.

      - added check for first string parameter Opt/ControlSendCommand/Mouse*

      - improved error message for block structures missing closing keyword (if/select/while...)

      - prints all output to stdout - not to stderr anymore

      - prints number of errors/warning as summery.

      - updated .def file.

Download in first post - will update that post later.

Have a nice weekend.

<{POST_SNAPBACK}>

Changes look good, except 1. I kind of liked the output going to stderr. This made it very easy to automate batch scanning of files. By redirecting output to a file, any file that had a non-zero size had errors. Thats not possible now since the file name and Au3Check version is printed to the same location as the errors.

With that said, how about a command line option to strip extraneous information leaving just the errors? Something like /errorsonly, perhaps?

Thanks for the other changes, though, they look good.

Share this post


Link to post
Share on other sites

tylo, question and a bug.

First the question, what is the number 1 for in this (And all other) lines?

%Opt 1 CaretCoordMode

Second, the bug. This feature appears to only match the first parameter, which means ControlCommand() is bugged (it's variable parameter is the 4th). I thought perhaps the number told Au3Check which parameter to match against, but that doesn't appear to be the case. If that were the case, though, then my question would be answered and the bug fixed by just changing all ControlCommand() stuff to a 4.

Share this post


Link to post
Share on other sites

Tylo,

thanks for the update. I guess that I am doing something wrong but I still cannot get my editor to use the output of your program.

Perhaps another option would be to have an "-out" parameter where you cold specify that you want to program to output the check results to a file instead of to stdout or stderr? That combined to Valik's suggestion would make this easier to use with other editors.

Cheers,

Angel

Share this post


Link to post
Share on other sites

Angel, it writes to stdout. If the editor captures stdout, then it will capture the text, otherwise, running it as such will send the text to a file:

au3check.exe "My Au3 File.au3" > file.txt

Share this post


Link to post
Share on other sites

Valik: Alright, I'll put error output back to stderr, and add an -q option (quiet) for errors only output.

The 1 in '%Opt 1 CaretCoordMode' should mean what you though - parameter one. Unfortunately, it currently support the first parameter only (I forgot that ContolCommand had its "enum" parameter as second). It is a bit of work to support multiple parameter, as the original intention was. But I'll take another look at it.

Anglel: As Valik said, you should be able to redirect with >, but I may add an output to file as well - maybe.

Share this post


Link to post
Share on other sites

Valik: Alright, I'll put error output back to stderr, and add an -q option (quiet) for errors only output.

The 1 in '%Opt 1 CaretCoordMode' should mean what you though - parameter one. Unfortunately, it currently support the first parameter only (I forgot that ContolCommand had its "enum" parameter as second). It is a bit of work to support multiple parameter, as the original intention was. But I'll take another look at it.

Anglel: As Valik said, you should be able to redirect with >, but I may add an output to file as well - maybe.

<{POST_SNAPBACK}>

Well, leaving it at stdout would be perfectly fine with the -q option. I only felt that one or the other was important, both probably aren't. But its your call on that. I will definitely be using the -q option, though.

Thanks for taking a look at the other issue.

Share this post


Link to post
Share on other sites

au3check v1.12 : Fixed: checks string values for up to 4 parameters now. Added -q (quiet) option.

Note the current limitation of parameters that can be checked. Enough for ControlCommand().

<{POST_SNAPBACK}>

Cool. Thanks for the quick changes.

Share this post


Link to post
Share on other sites

Ugh, new syntax change with optional/default parameters in user functions breaks Au3Check. I hope this is something you can fix, tylo, because I looked at some of the code and I don't know where to begin to support this new feature.

Share this post


Link to post
Share on other sites

Ugh, new syntax change with optional/default parameters in user functions breaks Au3Check.  I hope this is something you can fix, tylo, because I looked at some of the code and I don't know where to begin to support this new feature.

<{POST_SNAPBACK}>

Sure, its an easy addition to the yacc code. I assume that only literal numbers, strings and macros can be given as default values, and not for Byref params.

parameter
    : VARIABLE '=' NUMBER   { ... }
    | VARIABLE '=' STRING   { ... }
    | VARIABLE '=' MACRO   { ... }
    | VARIABLE                    { ... }
    | K_ByRef VARIABLE       { ... }
;

I will upload a new version soon.

Share this post


Link to post
Share on other sites

Cool, thanks. I didn't know it would be that easy.

Also, while you're updating, remember to support the new registry keys Jon has changed to. I had to manually change those myself and recompile.

Share this post


Link to post
Share on other sites

Sure, its an easy addition to the yacc code. I assume that only literal numbers, strings and macros can be given as default values, and not for Byref params.

parameter
    : VARIABLE '=' NUMBER   { ... }
    | VARIABLE '=' STRING   { ... }
    | VARIABLE '=' MACRO   { ... }
    | VARIABLE                    { ... }
    | K_ByRef VARIABLE       { ... }
;

I will upload a new version soon.

Just strings and numbers at the mo.

Share this post


Link to post
Share on other sites

Ok, au3check v1.13

- Accept optional parameters with default values (nums and strings).

- Checks that params following optional are also optional.

- Changed registry lookup for includes search

Did some code "improvements", so lets hope nothing is broken.

Edited by tylo

Share this post


Link to post
Share on other sites

Ok, au3check v1.13

- Accept optional parameters with default values (nums and strings).

- Checks that params following optional are also optional. 

- Changed registry lookup for includes search

Did some code "improvements", so lets hope nothing is broken.

<{POST_SNAPBACK}>

Thanks tylo. I just recompiled 23 scripts, all of which get Au3Check'd first. I saw no problems as a result of your "improvements".

Share this post


Link to post
Share on other sites

Ok, au3check v1.13

- Accept optional parameters with default values (nums and strings).

- Checks that params following optional are also optional. 

- Changed registry lookup for includes search

Did some code "improvements", so lets hope nothing is broken.

<{POST_SNAPBACK}>

Tylo,

Had a quick look at the source and saw you only support the NEW registry location in this new version. The tempfix version I included in the latest Scite4AutoIt3 checks the new location first and when that doesn't exist check the old registrykeys for the include info to support the folks using the 3.0.102 version.

Thanks,

Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        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

×
×
  • Create New...