Jump to content

Conditional compilation?


Recommended Posts

I took a peek on this beta, and you choosed option 3 : the internal preprocessor comes, reads the entire file, then might find the name of another preprocessor in it, then will call the new preprocessor.

Here are my thoughts about it:

;line 452
#Region Input retrieval/validation
;line 566
Retrieve_PreProcessor_Info() ;Hopefully another preprocessor is set here. Or maybe not.
;line 820
#EndRegion Input retrieval/validation
;line 889
#Region Run PreProcessor
;Following #instructions CANNOT (de-)influence what Retrieve_PreProcessor_Info() has already read.
;Unable use :
;   #pragma compile("AutoItExecuteAllowed",\
;                   true)
;Following #instructions CAN influence the rest of the compilation
;Usefull use :
;   #define UNICODE_VERSION_MAJOR 5
;   Local $version = 4
;   #ifdef UNICODE_VERSION_MAJOR
;      if ($version < UNICODE_VERSION_MAJOR) Then MsgBox(0, "Update required.", "Unicode version " & $version & " lower than expected : " & UNICODE_VERSION_MAJOR)
;   #endif
;line 932
#EndRegion Run PreProcessor

I'm not satisfied with this proposal, I'd rather run the internal preprocessor after the external one. That seems a lot of changes, but the only reason why Retrieve_PreProcessor_Info() have to be called before is to extract the $INP_Run_PreProcess_PGM from the script file.

I don't feel comfy in sharing my sourcecode with a #AutoIt3Wrapper_Run_PreProcess_Program="C:\Users\Noémie\Documents\Scripts\AutoIt3\SciTE\AutoIt3Wrapper\preprocessor.exe" attached, and I'm not keen on having to manually set this line to all of my new (moreover existing) script files...
Is there an other way to tell the Wrapper which file to use as preprocessor option ?

Note: I don't recommend the #AutoIt3Wrapper_Run_PreProcess_OutFile option, as it's supposed to be a simple Tempfile anyway. Besides, it is overriding the $ScriptFile_Out's tests, making it possible to have $ScriptFile_In = $ScriptFile_Out when wrongly set.

Link to comment
Share on other sites

  • Developers

Seems you havent read my post fully where is stated that autoit3wrapper doesnt perform these type of actions and never will.

As you deemed this proposal unacceptable,  I have reverted the changes and remove the current Beta and wish you success with your endeavour..

Jos

Edited by Jos

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

Link to comment
Share on other sites

You don't have to actually revert all the changes you made. You asked me to have a try, so I did. #AutoIt3Wrapper_Run_PreProcess_OutFile option is a wrong idea, #AutoIt3Wrapper_Run_PreProcess_Program is a good one.
I told you why I don't like some parts of your proposal.

We surely can find some place inbetween your implementations and my wishes, can't we ?

Edit : Or, we can't. Since the internal preprocessor is not likely to have any changes before ages, I can maintain my own Retrieve_PreProcessor_Info() manually after a stable release update. Sorry for the inconvenience, please just don't use what I shared before.

Edited by Denver
Np.
Link to comment
Share on other sites

  • Developers

No worries and am sure you wont be posting any autoit3wrapper versions with your modifications in it to avoid people getting confused.

jos

Edited by Jos

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

Link to comment
Share on other sites

You should not try to make your own version of AutoIt3Wrapper as that is modified and distributed by me on a regular basis.
When we feel we should have a pre-processor capability available in AutoIt3Wrapper, I should add an option to shell this external program like I have done for Au3Stripper by adding logic to AutoIt3Wrapper to read some preprocessors, in which you can define your pre-processor program file and the output file created.

EG:

#AutoIt3Wrapper_Run_PreProcess_Program=c:\mypreprocessor.exe
#AutoIt3Wrapper_Run_PreProcess_OutFile=%temp%\preproc.au3

AutoIt3Wrapper could then run this before the au3stripper step and also run au3check against the outputfile from the preprocessor to ensure now errors occur after the pre-process step. It will provide the processed input scriptfile as the first parameter.
In this way people can make their own pre-processor and maintain it independently from any modifications I make in AutoIt3Wrapper.

Thoughts?

Jos

 

Whether using this I can initially use Au3Stripper, I would like to first use
/StripOnly and /rsln
save a copy so prepared file
and later also on the prepared file
again use Au3Stripper but with this param:
/PreExpand and /RM

thus I would have the smallest possible file, in the form of before and after using: /PreExpand and /RM

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

  • 3 years later...
  • Developers
13 minutes ago, xerox said:

How to use a C preprocessor with AutoIt?

Why would you think this is possible at all?

Jos

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...