Jump to content



Photo

Report Help File Issues Here


  • This topic is locked This topic is locked
625 replies to this topic

#341 twitchyliquid64

twitchyliquid64

    Peace. Always.

  • Active Members
  • PipPipPipPipPipPip
  • 520 posts

Posted 05 July 2012 - 12:47 PM

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, 05 July 2012 - 12:56 PM.

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







#342 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 6,877 posts

Posted 05 July 2012 - 01:13 PM

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.

How to ask questions the smart way!

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 editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.

GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.

Posted Image


#343 John

John

    Polymath

  • Active Members
  • PipPipPipPip
  • 223 posts

Posted 05 July 2012 - 01:22 PM

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, 05 July 2012 - 01:23 PM.


#344 twitchyliquid64

twitchyliquid64

    Peace. Always.

  • Active Members
  • PipPipPipPipPipPip
  • 520 posts

Posted 05 July 2012 - 01:55 PM

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

#345 twitchyliquid64

twitchyliquid64

    Peace. Always.

  • Active Members
  • PipPipPipPipPipPip
  • 520 posts

Posted 05 July 2012 - 01:57 PM

From the help file you linked:

[color=#000000][font=Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif][size=4]

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

#346 John

John

    Polymath

  • Active Members
  • PipPipPipPip
  • 223 posts

Posted 05 July 2012 - 02:10 PM

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.

#347 Manadar

Manadar

    Taking a REST.

  • MVPs
  • 10,714 posts

Posted 05 July 2012 - 02:28 PM

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, 05 July 2012 - 02:30 PM.


#348 twitchyliquid64

twitchyliquid64

    Peace. Always.

  • Active Members
  • PipPipPipPipPipPip
  • 520 posts

Posted 05 July 2012 - 02:29 PM

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, 05 July 2012 - 02:30 PM.

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

#349 twitchyliquid64

twitchyliquid64

    Peace. Always.

  • Active Members
  • PipPipPipPipPipPip
  • 520 posts

Posted 05 July 2012 - 02:35 PM

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

#350 John

John

    Polymath

  • Active Members
  • PipPipPipPip
  • 223 posts

Posted 05 July 2012 - 02:53 PM

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.

#351 trancexx

trancexx

    Hm, I really shouldn't.

  • Active Members
  • PipPipPipPipPipPip
  • 5,194 posts

Posted 05 July 2012 - 02:59 PM

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, 05 July 2012 - 03:03 PM.

eMyvnE


#352 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 05 July 2012 - 03:19 PM

<--- Is SMRT. Knows what's wrong (Without cheating and using developer knowledge).

#353 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 6,877 posts

Posted 05 July 2012 - 03:26 PM

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?

How to ask questions the smart way!

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 editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.

GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.

Posted Image


#354 twitchyliquid64

twitchyliquid64

    Peace. Always.

  • Active Members
  • PipPipPipPipPipPip
  • 520 posts

Posted 06 July 2012 - 06:17 AM

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

#355 John

John

    Polymath

  • Active Members
  • PipPipPipPip
  • 223 posts

Posted 06 July 2012 - 02:42 PM

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.

#356 John

John

    Polymath

  • Active Members
  • PipPipPipPip
  • 223 posts

Posted 06 July 2012 - 06:04 PM

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.

#357 trancexx

trancexx

    Hm, I really shouldn't.

  • Active Members
  • PipPipPipPipPipPip
  • 5,194 posts

Posted 06 July 2012 - 08:00 PM

You are going way too off-topic. If I wanted that I would have replied already.
This thread is with specific purpose, so if you don't mind...

eMyvnE


#358 AZJIO

AZJIO

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,001 posts

Posted 07 July 2012 - 04:02 AM

$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, 09 July 2012 - 06:24 AM.


#359 guinness

guinness

    guinness

  • MVPs
  • 10,428 posts

Posted 11 July 2012 - 11:19 PM

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.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_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()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_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()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#360 guinness

guinness

    guinness

  • MVPs
  • 10,428 posts

Posted 11 July 2012 - 11:55 PM

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[/color]

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.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_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()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_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()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users