Sign in to follow this  
Followers 0
sohfeyr

directives documentation?

14 posts in this topic

I'm having trouble finding the documentation for the preprocessor directives and/or other things that start with #. I've checked the AutoIt and SciTe help files without success. Specifically I want to know more about #forceref, but I'd also like to know more about the #compiler directives. Could anyone point me towards where those are documented?

Share this post


Link to post
Share on other sites



I'm having trouble finding the documentation for the preprocessor directives and/or other things that start with #. I've checked the AutoIt and SciTe help files without success. Specifically I want to know more about #forceref, but I'd also like to know more about the #compiler directives. Could anyone point me towards where those are documented?

Here you go!

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

or directives in general.

I mean... how does AutoIt know that #Compiler_UseUpx (or any other directive) is valid? Can I create my own? What are they? Where do they come from.

I got curious when I tried to learn more about #Region #EndRegion and couldn't find anything.

- LD

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I mean... how does AutoIt know that #Compiler_UseUpx (or any other directive) is valid? Can I create my own? What are they? Where do they come from.

#Compiler... directives are instructions sent to AutoIt3Wrapper. Thus, the directives are not for Aut2Exe exclusively, but for the programming editor that is using AutoIt3Wrapper.

I got curious when I tried to learn more about #Region #EndRegion and couldn't find anything.

#Region and #EndRegion began it's humble beginnings from C#. Since it is incorporated into most programming editors now, then it gives good opportunity to take advantage of using it in other langauges.

The mentioned compiler directives are not AutoIt directives but what JdeB has introduced for AutoIt3Wrapper, so you need to look at the Scite4AutoIt3 site for information or look at the help file for Scite4AutoIt3.

:whistle:

Edited by MHz

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Thank you, that certainly covers the #Compiler_ directives, but I'm still in the dark about #forceref - anyone know about that?

In general: Autoit3 ignores all Directives except #include, #include-once ,#NotrayIcon, #cs,#ce,#commentstart and #commentend.

So both Au3check and AutoIt3Wrapper (as Mhz pointed out) use Compiler directives to "configure" these programs:

Au3check uses:

#forceref=      ; used to tell au3check not to generate an error for a "variable not referenced"
#Compiler_PlugIn_Funcs= ; Use to define the Functions available in A PlugIn DLL to avoid Au3Check errors

AutoIt3Wrapper uses:

#Region Compiler directives section
;** This is a list of compiler directives used by AutoIt3Wrapper.exe.
;** comment the lines you don't need or else it will override the default settings
#Compiler_Prompt=n                    ;y=show compile menu   
;** AUTOIT3 settings
#Compiler_AUTOIT3=                    ;Override the default Interpreter version.
;** AUT2EXE settings
#Compiler_AUT2EXE=                    ;Override the default compiler with this version.
#Compiler_Icon=                      ;Filename of the Ico file to use
#Compiler_OutFile=                    ;Target exe/a3x filename.
#Compiler_OutFile_Type=exe            ;a3x=small AutoIt3 file;  exe=Standalone executable(Default)
#Compiler_Compression=2              ;Compression parameter 0-4  0=Low 2=normal 4=High
#Compiler_Allow_Decompile=y          ;y= allow decompile
#Compiler_PassPhrase=               ;Password to use for compilation
#Compiler_UseUpx=y                    ;(y/n) Compress output program works only for 3.1.1.110 and up. Default=Yes
;** Target program Resource info
#Compiler_Res_Comment=                ;Comment field
#Compiler_Res_Description=            ;Description field
#Compiler_Res_Fileversion=            ;File Version
#Compiler_Res_FileVersion_AutoIncrement=y;AutoIncrement FileVersion After Aut2EXE is finished.
#Compiler_Res_LegalCopyright=       ;Copyright field
; free form resource fields ... max 15
; you can use the following variables:
; %AutoItVer% which will be replaced with the version of AutoIt3
; %date% = PC date in short date format
; %longdate% = PC date in long date format
; %time% = PC timeformat
#Compiler_Res_Field=AutoIt Version|%AutoItVer%
#Compiler_Res_Field=Name|Value        ;Free format fieldname|fieldvalue
#Compiler_Res_Field=Name|Value        ;Free format fieldname|fieldvalue
#Compiler_Res_Field=Name|Value        ;Free format fieldname|fieldvalue
#Compiler_Res_Field=Name|Value        ;Free format fieldname|fieldvalue
; Tidy Settings
#Compiler_Run_Tidy=y                    ;Run au3check before compilation. default=y
#Compiler_Tidy_Stop_onerror=y       ;Continue when only Warnings. default=y
#Tidy_Parameters=                   ;Tidy Parameters...see SciTE4AutoIt3 Helpfile for options 
; AU3CHECK settings
#Compiler_Run_AU3Check=              ;(Y/N) Run au3check before compilation. Default=Y
#Compiler_AU3Check_Parameters=        ;Au3Check parameters
#Compiler_AU3Check_Dat=              ;Override the default au3check definition
#Compiler_AU3Check_Stop_OnWarning=    ;(Y/N) N=Continue on Warnings.(Default) Y=Always stop on Warnings #Compiler_AU3Check_Parameters= 
#Compiler_PlugIn_Funcs=              ;Define PlugIn function names separated by a Comma to avoid AU3Check errors
; RUN BEFORE AND AFTER definitions
; The following directives can contain:
;   %in% , %out%, %icon% which will be replaced by the fullpath\filename.
;   %scriptdir% same as @ScriptDir and %scriptfile% = filename without extension.
;   %fileversion% is the information from the #Compiler_Res_Fileversion directive
;   %scitedir% will be replaced by the SciTE program directory
#Compiler_Run_Before=     ;process to run before compilation - you can have multiple records that will be processed in sequence
#Compiler_Run_After=    ;process to run After compilation - you can have multiple records that will be processed in sequence
#Compiler_Run_cvsWrapper=y ;(y/n) Run cvsWrapper to update the script source. Default=n
; Run Settings
#Run_Debug_Mode=n         ; Run Script with console debugging 
#EndRegion
Edited by JdeB

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

So then when it comes to #Region #EndRegion... am I correct in saying that AutoIt ignores those, but Scite recognizes them?

- LD

Share this post


Link to post
Share on other sites

One more thing:

#Compiler_PlugIn_Funcs=             ;Define PlugIn function names separated by a Comma to avoid AU3Check errors

Au3check doesn't like this line! I think its Au3check anyway... when you are using SciTe and hit Ctrl+F5 (Check Syntax) it gives an error "Incorrect Syntax" for that line.

- LD

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

One more thing:

#Compiler_PlugIn_Funcs=     ;Define PlugIn function names separated by a Comma to avoid AU3Check errors

Au3check doesn't like this line! I think its Au3check anyway... when you are using SciTe and hit Ctrl+F5 (Check Syntax) it gives an error "Incorrect Syntax" for that line.

- LD

True,

It was originally only in AutoIt3Wrapper and later added to au3check, but the au3check implementation doesn't like the comment at the end ....

Edited by JdeB

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

So then when it comes to #Region #EndRegion... am I correct in saying that AutoIt ignores those, but Scite recognizes them?

Correct, AutoIt will ignore any line that starts with #, except for the AutoIt directives that JdeB mentioned above.

In general: Autoit3 ignores all Directives except #include, #include-once, #NotrayIcon, #cs, #ce, #commentstart and #commentend.

:whistle:

Share this post


Link to post
Share on other sites

So #forceref, means to make sure a var is declared?

In the below example, #forceref is requiring $hWndGUI, $MsgID, and $wParam to be declared ?

Func WM_Notify_Events($hWndGUI, $MsgID, $wParam, $lParam)
    #forceref $hWndGUI, $MsgID, $wParam
    Local $tagNMHDR, $event
    $tagNMHDR = DllStructCreate("int;int;int", $lParam);NMHDR (hwndFrom, idFrom, code)
    If @error Then Return
    $event = DllStructGetData($tagNMHDR, 3)
    Select
        Case $wParam = $list
            Select
                Case $event = $NM_CLICK
                    $seltxt = StringSplit(_GUICtrlListViewGetItemText($list), '|')
                    If UBound($seltxt) - 1 = 2 Then
                        GUICtrlSetData($input1, $seltxt[1])
                        GUICtrlSetData($input2, $seltxt[2])
                    EndIf
            EndSelect
    EndSelect
    $tagNMHDR = 0
    $event = 0
    $lParam = 0
    Return $GUI_RUNDEFMSG
EndFunc

A decision is a powerful thing

Share this post


Link to post
Share on other sites

So #forceref, means to make sure a var is declared?

In the below example, #forceref is requiring $hWndGUI, $MsgID, and $wParam to be declared ?

No... as said, AutoIt3 doesn't do anything with this directive.

It tells Au3Check not to report on when a variable isn't used and option -w5 is selected .


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

No... as said, AutoIt3 doesn't do anything with this directive.

It tells Au3Check not to report on when a variable isn't used and option -w5 is selected .

sweet so it's the oposite of what I said as far as Au3Check goes? What is option -w5? Is there documentation on this stuff?


A decision is a powerful thing

Share this post


Link to post
Share on other sites

AutoIt3 Syntax Checker v1.54 Copyright © Tylo 2006

Usage: Au3Check [-q][-d] [-u file] [-w[-] n].. [-v[-] n].. [-I dir].. file.au3

-q : quiet (only error/warn output)

-d : as Opt("MustDeclareVars", 1)

-I dir : additional directories for searching include files

-w 1 : already included file (on)

-w 2 : missing #comments-end (on)

-w 3 : already declared var (off)

-w 4 : local var used in global scope (off)

-w 5 : local var declared but not used (off)

-w 6 : warn when using Dim (off)

-v 1 : show include paths/files (off)

-v 2 : show lexer tokens (off)

-v 3 : show unreferenced UDFs and global variables (off)

Exit codes:

0 : success - no errors or warnings

1 : warning(s) only

2 : syntax error(s)

3 : usage or input error


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