Jump to content

Search the Community

Showing results for tags 'const local byref'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location


WWW


Interests

Found 1 result

  1. In my pursuit of applying 'good coding practice' to AutoIt, I draw your attention to the Const keyword and ask whether I should I use it in my own code when I already have an understanding of what the code is doing? Or should I use it for the purposes of debugging as Au3Check will flag a syntax error? #include <Constants.au3> Example() Func Example() Local $sMessage = 'Some message that is assigned to a variable which won''t be changed i.e. constant variable.' ; This won't change Local $iVar = 0 ; This variable in local scope will be changed. For $i = 1 To 10 $iVar += 1 Next MsgBox($MB_SYSTEMMODAL, '$iVar=' & $iVar, $sMessage) EndFunc ;==>Example OR should I use it regardless? #include <Constants.au3> Example() Func Example() Local Const $sMessage = 'Some message that is assigned to a variable which won''t be changed i.e. constant variable.' ; This won't change Local $iVar = 0 ; This variable in local scope will be changed. For $i = 1 To 10 $iVar += 1 Next MsgBox($MB_SYSTEMMODAL, '$iVar=' & $iVar, $sMessage) EndFunc ;==>Example Invoke an Au3Check error. #include <Constants.au3> Example() Func Example() Local Const $sMessage = 'Some message that is assigned to a variable which won''t be changed i.e. constant variable.' ; This won't change Local $iVar = 0 ; This variable in local scope will be changed. ; Creates an error as previously being declared as a Const. $sMessage = '' For $i = 1 To 10 $iVar += 1 Next MsgBox($MB_SYSTEMMODAL, '$iVar=' & $iVar, $sMessage) EndFunc ;==>Example
×
×
  • Create New...