Jump to content

Report Help File Issues Here


guinness
 Share

Recommended Posts

With the section on Operators, I feel it is incomplete. http://www.autoitscript.com/autoit3/docs/intro/lang_operators.htm

It mentions nothing on the Unary Addition or Subtraction operators; I feel they should be included - their precedence screw me over for an hour a few days ago.

;consider these
$var1 = +10 ;Valid but undocumented operator
$var2 = -10 ;Valid, well-known, yet still undocumented

Their precedence is higher than most operators (?).

Similarly, the DOT ('.') operator is not documented. I would very much like to know its precedence.

?Im guessing that unary and '.' precedence follow that of the C language?

EDIT: Add the [] primary expression to that list aswell, ?if it is treated like an operator in AutoIt?

Edited by twitchyliquid64

ongoing projects:-firestorm: Largescale P2P Social NetworkCompleted Autoit Programs/Scripts: Variable Pickler | Networked Streaming Audio (in pure autoIT) | firenet p2p web messenger | Proxy Checker | Dynamic Execute() Code Generator | P2P UDF | Graph Theory Proof of Concept - Breadth First search

Link to comment
Share on other sites

wouldn't those be sign indicators the way you wrote them? You're not adding or subtracting the way you're using them in your examples.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

From the help file you linked:

From highest precedence to lowest:

NOT

^

* /

+ -

&

< > <= >= = <> ==

AND OR

It's essentially the same order of precedence you learn in math class.

Edit: Misplaced quote brackets

Edited by John
Link to comment
Share on other sites

wouldn't those be sign indicators the way you wrote them? You're not adding or subtracting the way you're using them in your examples.

prefixing - or + is NOT an indicator of sign for the lexer. consider this:

$tar = -$u2

still valid no? believe me, they are unary operators.

ongoing projects:-firestorm: Largescale P2P Social NetworkCompleted Autoit Programs/Scripts: Variable Pickler | Networked Streaming Audio (in pure autoIT) | firenet p2p web messenger | Proxy Checker | Dynamic Execute() Code Generator | P2P UDF | Graph Theory Proof of Concept - Breadth First search

Link to comment
Share on other sites

From the help file you linked:

It's essentially the same order of precedence you learn in math class.

Edit: Misplaced quote brackets

I'm confused. how has this got anything to do with unary or dot operators.

ongoing projects:-firestorm: Largescale P2P Social NetworkCompleted Autoit Programs/Scripts: Variable Pickler | Networked Streaming Audio (in pure autoIT) | firenet p2p web messenger | Proxy Checker | Dynamic Execute() Code Generator | P2P UDF | Graph Theory Proof of Concept - Breadth First search

Link to comment
Share on other sites

prefixing - or + is NOT an indicator of sign for the lexer. consider this:

$tar = -$u2

still valid no? believe me, they are unary operators.

How might you expect this act? As written $u2 is an undefined variable. If $u2 is a valid number variable such as 3 then -$u2 is in fact -3. Looks like the sign to me, unless $u2 was already negative in which case it's positive. If it is a string then $tar returns -0, i.e., 0 or false, negating the variable.
Link to comment
Share on other sites

Whether they are sign indicators or unary operators is an implementation detail of the lexer. In latest public AutoIt source, they are both.

For clarity: - is the unary operator, except when preceded by a number. Then it's a sign indicator.

twitchyliquid is correct that they should be added as unary operators.

Edited by Manadar
Link to comment
Share on other sites

How might you expect this act? As written $u2 is an undefined variable. If $u2 is a valid number variable such as 3 then -$u2 is in fact -3. Looks like the sign to me, unless $u2 was already negative in which case it's positive. If it is a string then $tar returns -0, i.e., 0 or false, negating the variable.

your mixing up you terminology. sign is a 'field' of a signed numerical value.

in the example above, i am not 'signing the variable to be negative' because interpreters, compilers and even the languages themselves don't work that way.

what is happening is you are applying a unary minus operation - AkA negation operation, then storing the value.

like i said before; it is an operator - corresponding to an operation. as an operator, it must have a relative precedence (and i want to know, hence my original post).

Edited by twitchyliquid64

ongoing projects:-firestorm: Largescale P2P Social NetworkCompleted Autoit Programs/Scripts: Variable Pickler | Networked Streaming Audio (in pure autoIT) | firenet p2p web messenger | Proxy Checker | Dynamic Execute() Code Generator | P2P UDF | Graph Theory Proof of Concept - Breadth First search

Link to comment
Share on other sites

Whether they are sign indicators or unary operators is an implementation detail of the lexer. In latest public AutoIt source, they are both.

For clarity: - is the unary operator, except when preceded by a number. Then it's a sign indicator.

twitchyliquid is correct that they should be added as unary operators.

that's weird. what's the point of doing it in the lexing stage AND in operator parsing/shunting/shift-reducing???

Seems like more work + confusion to me.

ongoing projects:-firestorm: Largescale P2P Social NetworkCompleted Autoit Programs/Scripts: Variable Pickler | Networked Streaming Audio (in pure autoIT) | firenet p2p web messenger | Proxy Checker | Dynamic Execute() Code Generator | P2P UDF | Graph Theory Proof of Concept - Breadth First search

Link to comment
Share on other sites

Of course it's a unary operator. What I can't figure out what order of operation you might expect of it that's not included in both math class and the help file you linked. Your example of $tar = -$u2 acted exactly as I expected in all cases. How and why would you expect it to act any differently than what it does without violating standard logic and math principles? Give a concrete example.

Link to comment
Share on other sites

that's weird. what's the point of doing it in the lexing stage AND in operator parsing/shunting/shift-reducing???

Seems like more work + confusion to me.

Forget all you know about AutoIt and that you have deducted by examining the source you examined. There have been number of changes to the way numbers are treated.

Lexing stage is indeed sometimes a place where majority of the work is done, and should be done. AutoIt had very old bug with numbers which resulted in incorrect handling of this simple code:

$x = 0 - 2147483648

If one would run stable version of AutoIt then careful and smart people (ahh well) will see the wrongness of the result. Superficial people will say "I see nothing wrong".

Anyway, only lexer can help resolve that correctly so the parser can do its job correctly later.

"+" and "-" should be described better in the help file.

Edited by trancexx

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Call me superficial, but I don't understand what the result should be of "$x = 0 - 2147483648" if it's not supposed to be -2147483648?

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Well, this is my hypothesis:

2147483648 is 2^31, which is pretty much the boundary for signed 32 bit integers. My guess is that it was considered (either by the lexer or possible even the parser) as a 32bit signed int and it overflowed in some sense of the word (without detection and subsequent promotion). I don't know the specifics of the bug to be any more specific in my hypothesis.

ongoing projects:-firestorm: Largescale P2P Social NetworkCompleted Autoit Programs/Scripts: Variable Pickler | Networked Streaming Audio (in pure autoIT) | firenet p2p web messenger | Proxy Checker | Dynamic Execute() Code Generator | P2P UDF | Graph Theory Proof of Concept - Breadth First search

Link to comment
Share on other sites

Obviously this failure to handle $x = 0 - 2147483648 based on its failure to flip the sign when it exceeds its 32 bit address space. In principle it could have been intentional, but now that I look at results that significantly exceed 2147483648 it is weird behavior with or without abstracting the 32bit limit.

Link to comment
Share on other sites

Oh, I'm on a 64bit machine. So I get a different result for signed integers up to 9223372036854775807. If AutoIt performs some operation that attempts to exceed that it merely return no change. Otherwise it just hangs at int max for 64 bits. I assume it simply hangs at <=2147483648, depending on the operation, on 32bit machines.

Link to comment
Share on other sites

$tagWINDOWPOS

$SWP_ NOOWNERZORDER - contains a superfluous space

_GUICtrlStatusBar_GetHeight

Retrieves the height of a part

_GUICtrlStatusBar_SetIcon

If the control is in simple mode, this field is ignored

ignored ??? -1

_GUICtrlStatusBar_GetIcon

If this parameter is -1, the status bar is assumed to be a Simple Mode status bar.

If "Simple Mode" then -1

_GUICtrlStatusBar_GetRectEx

If the control is in simple mode this field is ignored and the rectangle of the status bar is returned

ignored ??? 0

_GUICtrIStatusBar_Create.au3

_GUICtrITab_Create.au3

_GUICtrITreeView_CIickltem.au3

_GUICtrITreeView_Create.au3

_GUICtrITreeView_GetEditControI.au3

_GUIImageList_Destroylcon.au3

_GUIImageList_Getlcon.au3

Case $NM_RDBLCLK ; The user has clicked the right mouse button within the control

double-clicked

_GUICtrlStatusBar_Create

MemoWrite("StatusBar Created with:" &amp;amp; @CRLF &amp;amp; _
            @TAB &amp;amp; "only Handle," &amp;amp; @CRLF &amp;amp; _
            @TAB &amp;amp; "part width number" &amp;amp; @CRLF &amp;amp; _
            @TAB &amp;amp; "part text array of 3 elements" &amp;amp; @CRLF)
not shown in the example

_GUICtrlStatusBar_SetBkColor

StatusBar controls cannot be painted if the "Windows XP style" is used.

_GUICtrlStatusBar_GetUnicodeFormat

_GUICtrlStatusBar_SetUnicodeFormat($hStatus, False)

_GUICtrlStatusBar_SetBkColor

_GUICtrlStatusBar_SetUnicodeFormat

_GUICtrlStatusBar_GetUnicodeFormat

_GUICtrlStatusBar_SetMinHeight

GUICreate("(Example 1)

GUIStyles.htm

Add $PBS_MARQUEE (Progress Bar), $LVS_EX_INFOTIP (ListView)

_GUICtrlListView_GetSelectionMark

_GUICtrlListView_SetSelectionMark

; Select multiple items ???????
    _GUICtrlListView_SetSelectionMark($hListView, 1)
Edited by AZJIO
Link to comment
Share on other sites

In relation to #2210 I question the validity of the remark in StringInStr help:

The count parameter must be longer than the substring being searched for.

(Emphasis mine.)

It seems to me that it should say:

The count parameter must be longer or equal than the substring being searched for.

or

The count parameter must not be shorter than the substring being searched for.

Done.

_GDIPlus_ImageLoadFromFile

When you are done with the image object, call _GDIPlus_ImageDispose to release the resources

Done.

In the section for StringFormat, one of the examples given is incorrect.

printf("%%10.10s = [%10.10s]n", $t);   [many monke]        left-justification but with a cutoff of 10 characters

This format does not mean Left Justification with 10 character cutoff, it stands for a minimum of 10 characters (spaces added as needed), and a cutoff at 10 characters, which will output the same string in the console, but are 2 vastly different meanings.

printf("%%-.10s = [%-.10s]n", $t);   [many monke]        left-justification but with a cutoff of 10 characters

This is how it should be written, the "-" means left justify, the ".10s" means that the string should be no longer than 10 characters long. If you were to replace the $t with $s in the two lines, you'd see the difference. The first one would output "[____monkey]" and the second would output "[monkey]".

Drove me crazy when a label wouldn't line up correctly for me because of added spaces in my strings. ;)

EDIT: I added underlining in the first output example because the forum eats extra spaces.

Done.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

GUICtrlCreateListView

If you add a style $LVS_EX_CHECKBOXES, then there are no borders, add style $WS_EX_CLIENTEDGE

Done.

_GUICtrlComboBox_GetMinVisible

Retrieve the minimum number

Success: True (???)

Already fixed.

Number

For the function "Number ()" needs the exact wording

A line starting with the letters have a numeric representation of zero. A line starting with digits and other characters comprising - clipped. Number is any sequence of numbers from 0 to 9. The symbols "+" and "-" can only be a prefix. Dot "." can be in any position, but reuse is perceived literally (as is).

StringReplace

Local $sText = StringReplace("this is a line of text", " ", "--")
Local $iReplacements = @extended
MsgBox(4096, "New string", "The new string is now:" & @CRLF & $sText)
MsgBox(4096, "Replacements", "The total number of replacements was:" & @CRLF & $iReplacements & " occurrences.")

$sText = StringReplace("this is a line of text", 12, "--")
MsgBox(4096,  'Replacements in position', $sText)
Already fixed.

_GDIPlus_GraphicsClear

; Clear the screen capture to solid blue

$tagSYSTEMTIME

MSeconds --> Milliseconds

$tagNETRESOURCE

$tagNETRESOURCE structure

$tagGDIPPENCODERPARAMS

$tagGDIPPENCODERPARAMS structure

$tagNMIPADDRESS

The new value of the field specified in the iField member.

_ClipBoard_ChangeChain

The handle must have been passed to the _ClipBoard_SetClipboardViewer function.

_FileListToArray

If @error = 1 Then

MsgBox(4096, "", "No Folders Found.")

1 = Path not found or invalid

_Iif

Local $i_Count, $i_Index

Fixed all.

_GUICtrlListView_GetFocusedGroup

_GUICtrlListView_GetGroupCount

_GUICtrlListView_GetGroupInfoByIndex

If @OSVersion = "WIN_XP" Then
        MsgBox(4160, "Information", "The function does not work in WinXP")
    Else
        MsgBox(4160, "Information", "Group Count: " & _GUICtrlListView_GetGroupCount($hListView))
    EndIf

_GUICtrlListView_GetTextBkColor

_GUICtrlListView_GetTextColor

_GUICtrlListView_SetBkColor

_GUICtrlListView_SetTextBkColor

_GUICtrlListView_SetTextColor

Download the source files yourself, edit accordingly and then re-upload to me please. Because some of the examples appear to be correct.

I will continue the rest of the updates in the next couple of days.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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