Jump to content
Sign in to follow this  
Mbee

Help me understand macros, please

Recommended Posts

Mbee

I apologize if I'm being stupid, but I could find no general explanation of how AutoIt's macros are implemented.  For example, I can't tell if they're evaluated at compile/build time (i.e., while running Aut2Exe) or at run time?

I've seen the documentation where the macros and their values are described, but nothing general about them.

Thanks.

Share this post


Link to post
Share on other sites
water

I think all are evaluated at run time. Some of them only once when the script is started (@CPUArch etc.), some more often (@error, @extended etc.)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
Mbee

I think all are evaluated at run time. Some of them only once when the script is started (@CPUArch etc.), some more often (@error, @extended etc.)

Hey, thanks, water! That's what I figured, but as I said I can't find any general info on the topic.

You've helped me before and now once again, and I'm very grateful!

Share this post


Link to post
Share on other sites
water

Glad to be of service :)

  • Like 1

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

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  

  • Similar Content

    • ces1a
      By ces1a
      I recently upgraded my laptop to one with Windows 10 and higher screen resolution.  In the process I found that some of my scripts did not work right when using Autoit's @DesktopWidth and @DesktopHeight macros.  Insteat of 1920 x 1080 resolution Autoit detects 1536 x 864.  Thus, GUIs designed to appear near the right edge of the screen  displayed closer to the horizontal middle of the screen.  I assume others may have the same problem.
      A search on this forum and Microsoft Script Center helped me to write the following script that gets the true screen width and height from WMI.
      MsgBox(0, '', _GetMonitorInfo())
      Func _GetMonitorInfo()
          Local $oWMI, $Listing, $sWidth = 0, $sHeight = 0
          $oWMI = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2")
          If IsObj($oWMI) Then
              $Listing = $oWMI.ExecQuery("SELECT * FROM Win32_DesktopMonitor")
              If IsObj($Listing) Then
                  For $oItem In $Listing
                      $sHeight = $oItem.ScreenHeight
                      $sWidth = $oItem.ScreenWidth
                  Next
              EndIf
          EndIf
          Return "Width: " & $sWidth & @CRLF & "Height: " & $sHeight
      EndFunc ;_GetMonitorInfo

      Hopefully it will benefit others.  I for sure am very happy with all the samples I been able to find here in the past.
    • skyhigh
      By skyhigh
      I am working at a script (thanks @Chimp for the help on my previous thread) operating on Firefox, based on two time-set loops that are doing the same operations with some differences.
      Now I need to execute a local video at a determinated hour (between 12 and 4).  
      My question is
      What is the best way to determine a precise hour (hh:mm)? I tried
      While @Hour >= 12 & @MIN >= 00 And @HOUR <= 14 & @MIN < 30 But the loop is being ignored, although in the moment I use only @Min for my tests everything works fine.
      This is the essential - and working - structure of the present script:
      #include <ff.au3> _FFStart() While @MIN >= 00 And @MIN < 30 ; 1st Firefox loop Firefox url loop (contains functions and if conditions) WEnd ;Open a new tab and runs a local video; While @MIN >= 32 And @MIN <= 59 ; 2nd Firefox loop Firefox url loop (contains functions and if conditions) WEnd Thanks in advance
    • SorryButImaNewbie
      By SorryButImaNewbie
      Happy Friday everyone!
      I would like to ask a pretty basic question, precisly whats the different between @ScriptDir and @AppDataDir? I know that @ScriptDir is the path for where the script (compiled/uncompiled version) is. Just today I read around some of the codes posted, and to me they seem to be similar after I read the help file. I didn't want to ask it in PM from the poster of the code where I read it
      Sorry for the elemetary question, and thank you for the enlightenment!
×