Jump to content

Recommended Posts

Posted (edited)

I did a search in the folder "include" and there is a function _WinAPI_PickIconDlg with the same string.
 
GUIGetCursorInfo

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>

Global $iInfo

GUICreate("Cursor Info", 420, 300)
$iInfo = GUICtrlCreateLabel('', 10, 10, 150, 72, $WS_BORDER)
GUICtrlCreateEdit("String", 170, 10, 240, 72)
GUICtrlCreateLabel("Label", 10, 90, 400, 40, $WS_BORDER)
GUICtrlCreateButton("Button", 10, 140, 100, 27)
GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_MOUSEMOVE
            _MemoWrite()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func _MemoWrite()
    Local $aInfo = GUIGetCursorInfo()
    If $aInfo[4] <> $iInfo Then
        GUICtrlSetData($iInfo, _
                '  x = ' & $aInfo[0] & @CRLF & _
                '  y = ' & $aInfo[1] & @CRLF & _
                '  ID = ' & $aInfo[4] & @CRLF & _
                '  Text = ' & GUICtrlRead($aInfo[4]))
    EndIf
EndFunc   ;==>_MemoWrite

Number

MsgBox(0, "Number", Number("0x000009"))

Unexpectedly. Hexadecimal numbers are supported.

 

GUICtrlSetState

Local $iOK = GUICtrlCreateButton("OK", 310, 370, 85, 25)

Why there this line?

 

GUICtrlCreateObj

; ; See also
Edited by AZJIO
Posted
All the time I wonder some specifics, naming parameters.
My question is why some of the parameters are called using quotes, and others without such marks,
 
As an example syntax for three functions:
FileSaveDialog ("title", "init dir", "filter" [, options = 0 [, "default name" [, hwnd]]])
ControlCommand ("title", "text", controlID, "command" [, "option"])
WinWait ("title" [, "text" [, timeout = 0]])
 
 
With this function,
FileSaveDialog ("title", "init dir", "filter" [, options = 0 [, "default name" [, hwnd]]])

This is all the more confusing because, for example the "default name"

I think should be described as
FileSaveDialog ("title", "init dir", "filter" [, options = 0 [, default_name = "" [, hwnd]]])
 
Just as in the case of
WinWait ("title" [, "text" [, timeout = 0]])

it should be like this:

WinWait ("title" [, text = "" [, timeout = 0]])
 
 
In general I would suggest that in the naming of the parameter does not use spaces, but instead suggest to use underscores:
so instead of:
FileSaveDialog ("title", "init dir", "filter" [, options = 0 [, "default name" [, hwnd]]])

proposes to adopt such a convention:

FileSaveDialog (title, init_dir, filter [, options = 0 [, default_name = "" [, hwnd]]])

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:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Title, text, init dir, and filter are all strings, you need to enclose strings in quotes. Numbers aren't required to be enclosed in quotes because they're numbers.

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!

  Reveal hidden contents

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

Posted

ok

so instead of:
FileSaveDialog ("title", "init dir", "filter" [, options = 0 [, "default name" [, hwnd]]])

such a description :

FileSaveDialog ("title", "init_dir", "filter" [, options = 0 [, "default_name" = "" [, hwnd]]])

 

and

WinWait ("title" [, "text" = "" [, timeout = 0]])

is correct ?

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:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

No,

"text" means that it's the text of the window (parameter named text), and the quotes means that it's a string.

If you want to show the default value it would be:

title [, text = "" [ ...

Br, FireFox.

Edited by FireFox
Posted (edited)

ok

EDIT: no now it is clear for me

but what about the names of the parameters and the use of spaces / underscores?

 

in the previous examples already showed you what I mean but additionally give you an example:

SplashImageOn ( "title", "file" [, width [, height [, x pos [, y pos [, opt]]]]] )

and the proposal:

SplashImageOn ( "title", "file" [, width [, height [, x_pos [, y_pos [, opt]]]]] )
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:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

  On 9/9/2013 at 2:26 PM, mlipok said:

but what about the names of the parameters and the use of spaces / underscores?

I don't understand.

 

  On 9/9/2013 at 2:26 PM, mlipok said:

in the previous examples already showed you what I mean but additionally give you an example:

SplashImageOn ( "title", "file" [, width [, height [, x pos [, y pos [, opt]]]]] )
and the proposal:

SplashImageOn ( "title", "file" [, width [, height [, x_pos [, y_pos [, opt]]]]] )

I don't see any difference.
Posted
  On 9/9/2013 at 2:30 PM, FireFox said:

I don't see any difference.

 

  On 9/9/2013 at 8:48 AM, mlipok said:

In general I would suggest that in the naming of the parameter does not use spaces, but instead suggest to use underscores:

 

  On 9/9/2013 at 2:30 PM, FireFox said:

I don't see any difference.

 

x pos >> x_pos

y pos >> y_pos

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:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

I would really be careful when suggesting changes to native function documentation.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

So I withdraw my suggestion.

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:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

If...ElseIf...Else...EndIf

If <expression> Then
    statements
    ...
[ElseIf expression-n Then
    [elseif statements ... ]]
    ...
[Else
    [else statements]
    ...
EndIf
The number of opening and closing brackets do not match.

If <expression> Then

statements

...

[ElseIf <expression-n> Then

[elseif statements ... ]]

...

[Else

[else statements]]

...

EndIf

 

expression
    An expression that returns after calculating True or False
statements
    Block of statements that is executed if the associated expression is True
Remarks

Algorithm is as follows: sequential calculate of expressions <expression> until a expressions is True. Once that happened, he belonging executed the statement block . Otherwise, executed the statement block belonging Else, if it exists. Only one statement block executed and other expressions have not calculated.

_________________________

In the design "For...To...Step...Next, If...ElseIf...Else...EndIf, Switch, Select, While, Do" a parameter "statements", which is missing in the description of the parameters. In my opinion it should be added to as "statements | Block operators"

Edited by AZJIO
Posted (edited)

_StringBetween

Description says: "Find strings between two sets of characters."

This is misleading: $sStart and $sEnd are definitely not character sets, but character sequences, or substrings if you prefer.

Now I'd also like opinions about an issue I see in the behavior of the function itself, when $sStart = $sEnd.

Local $aRes = _StringBetween("abbbaccca", "a", "a")
; "bbb" is between "a" and "a"
; "ccc" is also between "a" and "a" but is not returned
_ArrayDisplay($aRes)

I see that as a bug but I'd like other views.

Edited by jchd
  Reveal hidden contents

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Posted

It looks like the RegEx being used isn't taking the second a as the start of the search pattern, seeing as how (as I understand it) RE searches a character at a time until it finds the first match, stops when it finds the second match, then starts searching from where it left off +1.

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!

  Reveal hidden contents

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

Posted

Yes, that's how it currently works. $sEnd ought to be a look-ahead, or am I missing something?

  Reveal hidden contents

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Posted (edited)
  On 9/9/2013 at 4:56 PM, AZJIO said:

 

In the design "For...To...Step...Next, If...ElseIf...Else...EndIf, Switch, Select, While, Do" a parameter "statements", which is missing in the description of the parameters. In my opinion it should be added to as "statements | Block operators"

 

 

So far I did not think about the "statement" as a parameter, I still do not think so.
 
I think:
Select ... Case ... EndSelect
 
have a good description of the parameters in the description because it is clearly stated what happens to the "statement".
 
If the expression is true The Following statements up to the next Case or EndSelect statement are executed.
If more than one of the Case statements are true, only the first one is executed.
 
 
I see also good descriptions of these functions:
If ... ElseIf ... Else ... EndIf
Do ... Until
While ... Wend
 
 
 
but I think that, in these functions
For ... In ... Next
Switch ... Case ... EndSwitch
For ... To ... Next Step ...
 
not sufficiently clear indication that what is the relationship between "expression" <> "statement"
 
 
 
and just as the documentation for the function
With ... EndWith
 
How I se about this function AZJIO, did not mention.
 
 
EDIT: "typos, errors"
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:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

mlipok

  Quote

So far I did not think about the "statement" as a parameter, I still do not think so.

Any element which doesn't belong to a keyword is parameter.

 

  Quote

have a good description of the parameters in the description because it is clearly stated what happens to the "statement".

This description of function. It isn't the description of this parameter.

 

  Quote

How I se about this function AZJIO, did not mention.

I left for a snack.
Posted (edited)

 

  On 9/13/2013 at 6:06 AM, AZJIO said:

Any element which doesn't belong to a keyword is parameter.

 

so

in Select...Case...EndSelect

in Parameters

there is   "Case <expression>"  

How I think "Case" is a keyword not parameter ?

Am I right, or am I wrong?

  On 9/13/2013 at 6:06 AM, AZJIO said:

This description of function. It isn't the description of this parameter.

 

I mean that:

If the expression is true The Following statements up to the next Case or EndSelect statement are executed.
If more than one of the Case statements are true, only the first one is executed.

This is description to parameter named "Case <expression>" 

 


BTW

Select
    Case <expression>
    statement1
    ...
    [Case 
    statement2
    ...]
    [Case Else
    statementN
    ...]
EndSelect

is that right ?

or that one is better ?

Select
    Case <expression 1>
    statement1
    ...
    [Case <expression 2> 
    statement2
    ...]
    [Case Else
    statementN
    ...]
EndSelect
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:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)
  Quote
BTW

I think it is broken. It used to be right.

<b>Case</b> &lt;expression&gt;<br>
<b>Case</b> <expression><br>

special characters are lost

statement to <statement>

  Quote
How I think "Case" is a keyword not parameter ?

 

Yes (Case = keyword)!

  Quote
 "Case <expression>"

Free interpretation

Edited by AZJIO
Posted
  On 9/13/2013 at 7:43 AM, AZJIO said:

special characters are lost

 

that's beside the point

i asking about   "<expression 2>"

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:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

I would have done so

Select 
    Case <expression 1>
        <statement 1
        ...>
    [Case <expression n>
        <statement n
        ...>]
    [Case Else
        <else statement
        ...>]
EndSelect
Edited by AZJIO

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
×
×
  • Create New...