Jump to content

Recommended Posts

Posted

IIRC empty arrays could only be created as returns from certain object's methods.

  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

I knew it was something technical that I didn't understand at the time I read it, just couldn't recall what. Either way, empty arrays aren't anything new, and old code usually never took them into account. You either had an array or you didn't, most didn't notice there were no actual elements in them.

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

Example 2 of GUICtrlCreateEdit gives the following error with 3.3.9.21:

  Quote

 

"C:\Program Files\AutoIt3\Beta\ExamplesHelpfileGUICtrlCreateEdit[2].au3" (37) : ==> Only Object-type variables allowed in a "With" statement.:

With $oRP
With ^ ERROR

 

 
Also this 2 error messages from the error handler:
  Quote

 

We intercepted a COM Error !

 
err.description is:
err.windescription: Invalid class string
 
err.number is: 800401F3
err.lastdllerror is: 0
err.scriptline is: 23
err.source is:
err.helpfile is:
err.helpcontext is:

 

  Quote

 

We intercepted a COM Error !

 
err.description is:
err.windescription: Unspecified error
 
err.number is: 80004005
err.lastdllerror is: 0
err.scriptline is: 34
err.source is:
err.helpfile is:
err.helpcontext is:

 

Windows 7 Ultimate - 32 bit

Posted (edited)

For me it's the same, but with 3.3.8.1. So beta version has nothing to do with it.

Edit: From example file: "Needs: MSCOMCT2.OCX in system32 but it's probably already there"

Edited by funkey

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Posted

@D4RKON3  and   @funkey

check out this Track ticket: #2476

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)

try to use

ConsoleWrite(BinaryToString('0xDEADBEAF') & @CRLF)

or you mean something else ?

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)
  On 11/2/2013 at 9:39 PM, Jos said:

That doesn't look right to me.

 

I correct my self

 

  On 11/2/2013 at 9:32 PM, D4RKON3 said:

 

Is it a bug?

ConsoleWrite(Int("0xDEADBEAF") & @CRLF) ;Outputs -559038801 but it should be 3735928559

 

ConsoleWrite(HEX('3735928559') & @CRLF)
ConsoleWrite(Dec('DEADBEEF') & @CRLF)
ConsoleWrite(Dec('DEADBEAF') & @CRLF)

from doc:

"

Default behavior is that the input string is treated as an integer. In this case, if the result is within range of a 32bit integer then it's returned as a 32bit integer, otherwise it's returned as a 64bit integer - both signed.

"

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

I just don't know if it's how it's suppose to be or not, that's why I asked "Is it a bug?".

GUICreate("")
GUISetState()

ConsoleWrite(GUIGetStyle()[0] & @CRLF) ;Output: -1798701056
ConsoleWrite(Hex(GUIGetStyle()[0]) & @CRLF) ;Output: 94CA0000

;Using calculator in windows and converting 94CA0000 from hex to decimal gives: 2496266240
ConsoleWrite(VarGetType(2496266240) & @CRLF) ;Output: Int64
Posted (edited)
  On 11/2/2013 at 10:12 PM, D4RKON3 said:

 

I just don't know if it's how it's suppose to be or not, that's why I asked "Is it a bug?".

GUICreate("")
GUISetState()

ConsoleWrite(GUIGetStyle()[0] & @CRLF) ;Output: -1798701056
ConsoleWrite(Hex(GUIGetStyle()[0]) & @CRLF) ;Output: 94CA0000

;Using calculator in windows and converting 94CA0000 from hex to decimal gives: 2496266240
ConsoleWrite(VarGetType(2496266240) & @CRLF) ;Output: Int64 

 

always much safer to use Number(), here the correct way  in this case

ConsoleWrite(Number("0xDEADBEEF", 3) & @CRLF) ;Outputs 3735928559 

Ciao.

Edited by DXRW4E

apps-odrive.pngdrive_app_badge.png box-logo.png new_logo.png MEGA_Logo.png

Posted (edited)

32 bit Int  

have limitation

from −2 147 483 648  to +2 147 483 647 

this is 32 bit Signed Integer

ConsoleWrite(Int("0xDEADBEEF") & @CRLF) 

From Int doc:

  Quote

 

Default = the result is auto-sized integer. See remarks.

Default behavior is that if the result is within range of 32bit integer then 32bit integer is returned. If not, 64bit integer is returned. Both signed.

 

 
This is 64 bit Signed Integer
ConsoleWrite(Int("0x0DEADBEEF") & @CRLF)
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)
  On 11/2/2013 at 10:02 PM, DXRW4E said:
ConsoleWrite(Int("0x0DEADBEEF") & @CRLF) ;Outputs 3735928559

 

When You add 0 to DEADBEEF this number change from 32 bit signed Integer to 64 bit singed integer

  On 11/2/2013 at 10:29 PM, DXRW4E said:
ConsoleWrite(Hex(3735928559) & @CRLF) ;Outputs 00000000DEADBEEF seems to know it as 64bit
ConsoleWrite(Hex(2147483648) & @CRLF) ;Outputs 0000000080000000 seems to know it as 64bit
ConsoleWrite(Hex(1073741824) & @CRLF) ;Outputs 40000000

 

So once again:

ConsoleWrite(Hex(3735928559) & @CRLF) ;Outputs 00000000DEADBEEF seems to know it as 64bit
ConsoleWrite(Hex(2147483648) & @CRLF) ;Outputs 0000000080000000 seems to know it as 64bit
ConsoleWrite(Hex(2147483647) & @CRLF) ;Outputs 7FFFFFFF seems to know it as 32bit with + Sign
ConsoleWrite(Dec('80000000') & @CRLF) ;Outputs -2147483648 seems to know it as 32bit with - Sign
ConsoleWrite(Hex(1073741824) & @CRLF) ;Outputs 40000000

ConsoleWrite(HEX(3735928559) & @CRLF) ;Outputs 00000000DEADBEEF AutoIt know it as 64bit
ConsoleWrite(HEX(-559038801) & @CRLF) ;Outputs DEADBEAF AutoIt know it as 32bit
 

Taking into account all of the above it can be concluded that in this case:

00000000DEADBEEF = 0DEADBEEF <> DEADBEEF

because

Int() Default behavior treats these above numbers in that way:

64bit = 64bit <> 32bit

 

ps.

and for that I think all is OK
but maybe someone from the group of developers, explain the matter better.
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)

I think we're going offtopic, however here http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751%28v=vs.85%29.aspx#INT32

2147483647           - Hex = 7FFFFFFF           Bin = 1111111111111111111111111111111    ;BinaryLen 31
2147483648           - Hex = 80000000           Bin = 10000000000000000000000000000000   ;BinaryLen 32
9223372036854775807  - Hex = 7FFFFFFFFFFFFFFF   Bin = 111111111111111111111111111111111111111111111111111111111111111  ;BinaryLen 63
ect ect ect

Ciao.

Edited by DXRW4E

apps-odrive.pngdrive_app_badge.png box-logo.png new_logo.png MEGA_Logo.png

Posted (edited)
  On 11/2/2013 at 11:06 PM, DXRW4E said:

I think we're going offtopic, however here http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751%28v=vs.85%29.aspx#INT32

2147483647           - Hex = 7FFFFFFF           Bin = 1111111111111111111111111111111    ;BinaryLen 31
2147483648           - Hex = 80000000           Bin = 10000000000000000000000000000000   ;BinaryLen 32
9223372036854775807  - Hex = 7FFFFFFFFFFFFFFF   Bin = 111111111111111111111111111111111111111111111111111111111111111  ;BinaryLen 63
ect ect ect

Ciao.

 

You are using UINT type (unsigned)

 

but AutoIt Int() function use INT type (signed)

so using INT type (signed)

its look that:

  Quote

 

2147483647           - Hex = 7FFFFFFF         Bin = 01111111111111111111111111111111 ;BinaryLen 32

-2147483648           - Hex = 80000000           Bin = 10000000000000000000000000000000 ;BinaryLen 32

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)

I use Calculator (ViewProgrammer) in Windows 8.1 x64 to take the binary, UINT32 here http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751%28v=vs.85%29.aspx#UINT32

4294967295 - Hex = FFFFFFFF    Bin = 11111111111111111111111111111111    ;BinaryLen 32

the point we need to understand well such as Microsoft interprets certain things, because AutoIt (is forced) interprets them in the same way

Ciao.

Edited by DXRW4E

apps-odrive.pngdrive_app_badge.png box-logo.png new_logo.png MEGA_Logo.png

Posted

I think MS in calculator is doing something wrong when displaying in Hex 4294967295 on a qword.

If you convert the FFFFFFFF in dec dword you get back -1

If you try to paste 4294967295 to a dword you get an error

AutoIt respect as maximum what can be stored in 4 byte integer if the value cannot be stored in an int32 a int64 is used to keep the sign. The UINT32 MAX value is stored in an int64.

The only representation that cannot be stored is the MAX UINT64 as the 8-byte cannot stored the sign

Hex respect the max number of digit to use 4 or 8 bytes.

Cheers

JP

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
  • Recently Browsing   0 members

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