Sign in to follow this  
Followers 0
Phstiger

I don't understand about datatype

12 posts in this topic

In the Autoit Help only have 4 datatype basic: Numeric, BinaryString, Booleans, String.

Outwith, do it have datatype basic another? And Do this datatype defined in Autoit ?

I have seen with "DllStructCreate" function in "Autoit Help" have datatype: byte,ubyte,char,short, ushort,int,....

Do This datatype defined in APIs such as user32.dll ? And Do most datatype and functions had inherited from API library of Windows ?

Sorry you, because my english quick bad.

Please help me.

Thanks

Share this post


Link to post
Share on other sites



Hi.

In the Autoit Help only have 4 datatype basic: Numeric, BinaryString, Booleans, String.

Outwith, do it have datatype basic another?

Sorry you, because my english quick bad.

Never mind about your English, I can get your question :)

As nobody else did answer so far I'll try my very best, hope I got it correctly:

The Data Types you can find in Autoit Help File, "Language Reference, Datatypes", is all AUTOIT knows about.

But certain functions might require special datatype rules that the parameters passed to the function have to meet: As Windows APIs (or whatsoever) want it that way to "get" their parameters passed.

The datatype handling inside Autoit is very easy, as you can see in the "*" and "&" examples on top of the help page "Language Reference, Datatypes".

Have fun, Rudi.


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites

But certain functions might require special datatype rules that the parameters passed to the function have to meet: As Windows APIs (or whatsoever) want it that way to "get" their parameters passed.

So Windows APIS (ex: in user32.dll) not define in Auoit , it only define in user32.dll, doesn't it?

The datatype handling inside Autoit is very easy, as you can see in the "*" and "&" examples on top of the help page "Language Reference, Datatypes".

I want a example about:

With C++

void func_name(int &var)

{

......

}

How do Autoit use "&var" ?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Local $tStruct = DllStructCreate("int")
DllStructSetData($tStruct, 1, $var)
Local $aDLLCall = DllCall("yourdll.dll", "none", "func_name", "int*", DllStructGetPtr($tStruct, 1))
If IsArray($aDLLCall) Then MsgBox(64, "Value", $aDLLCall[0])

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

I have a problem.

In other program language such as C/C++.

With variable, it make a symbol tables in the stack and compare datatype of variable and execute command. Out of that datatype basic, it define other datatype as functions of it.

How do Autoit do?

Please explain for me.

Thanks

Share this post


Link to post
Share on other sites

I have a problem.

In other program language such as C/C++.

With variable, it make a symbol tables in the stack and compare datatype of variable and execute command. Out of that datatype basic, it define other datatype as functions of it.

How do Autoit do?

Please explain for me.

Thanks

It do very well, thank you. :)

AutoIt is a scripting language, not C/C++. It's variables are not what you call "strongly typed".

In addition, there are many places (but not all) where AutoIt will automatically convert data types to match required inputs. This happens with most native functions, but does not happen with most UDFs.

The AutoIt interpreter is written in C++, and down at that level, all AutoIt variables are type "Variant". AutoIt attaches its own identifying structure to match it's various Variant types with the various Windows APIs it talks to.

There are such AutoIt Variant types for more than what you mentioned in your earlier post. You left out arrays, objects, handles, and DLL structs (which SmOke_N gave you an example of).

Hope that helps.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I have a strangeness

With this code in Autoit version v3.2.2.0

if 1 < 2 Then

MsgBox(0,"Title","Alway is True")

Else

Aaaaaa ; never this execute command

EndIf

Autoit never send error message about error to user.

With Version v3.2.10.0

That error fixed, but with this code:

if 1 < 2 Then

MsgBox(0,"Title","Alway is True")

Else

MsgBox( ; never this execute command

EndIf

Autoit also never see this error

My question is: During execute command, Autoit read from one line to last line, but only read lines that true conditions.

Such "1<2" alway true , so Else "MsgBox(" never Autoit check it.

Edited by Phstiger

Share this post


Link to post
Share on other sites

I have a strangeness

With this code in Autoit version v3.2.2.0

Autoit never send error message about error to user.

With Version v3.2.10.0

That error fixed, but with this code:

Autoit also never see this error

My question is: During execute command, Autoit read from one line to last line, but only read lines that true conditions.

Such "1<2" alway true , so Else "MsgBox(" never Autoit check it.

Yes, it does check it, unless you have somehow disabled Syntax Check:
>Running AU3Check (1.54.10.0)  from:C:\Program Files\AutoIt3
C:\temp\Test\Test1.au3(4,37) : ERROR: syntax error
MsgBox(; never this execute command
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\temp\Test\Test1.au3 - 1 error(s), 0 warning(s)
!>13:14:48 AU3Check ended.rc:2
>Exit code: 0   Time: 6.076

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

The AutoIt interpreter is written in C++

I think. Compile language will make a exectable file (file.exe), and interpreter language will check from a first line to last line and not make exectable file.

Wiht C/C++ make exectable file, after run it.

About Autoit, if you talk about Autoit is interpreter language, why can Autoit make exectable file.

do Autoit make exectable file but insite it include source code file and when user run it, it will check every line and interpreter it.

Does it make size of Autoit bigger, because compiler of Autoit is written in C++ language, so executable file of it consit code of: "C++,Autoit"

Sorry, because my skill english quick bad. I am from VietNamese, so many line I don' t understand..... :)

Edited by Phstiger

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

If AutoIt3 had been compiled from machine code instead of C++, it could have been 74% - 85% of the size it is now. The scripts its compiles could be as small as 89% of the size they are.

The above is a squirrely wild guess - I mean extrapolation.

Edited by Squirrely1

Das Häschen benutzt Radar

Share this post


Link to post
Share on other sites

I think. Compile language will make a exectable file (file.exe), and interpreter language will check from a first line to last line and not make exectable file.

Wiht C/C++ make exectable file, after run it.

About Autoit, if you talk about Autoit is interpreter language, why can Autoit make exectable file.

do Autoit make exectable file but insite it include source code file and when user run it, it will check every line and interpreter it.

Does it make size of Autoit bigger, because compiler of Autoit is written in C++ language, so executable file of it consit code of: "C++,Autoit"

Sorry, because my skill english quick bad. I am from VietNamese, so many line I don' t understand..... :)

The simplest model of an AutoIt "compiled" script is the same as Perl scripts converted to .exe with Perl2Exe:

The interpreter is packed with the original script's text (after parsing compile-time directives and #include files). When you run the .exe the interpreter part interprets the script part.

It's not quite that simple in reality, because there is compression, encryption, and obsfucation of the original script text involved.

You can disable the syntax check and complete the compile of a broken script. But that's a bad idea.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Shortly, Autoit is scripting language and The AutoIt interpreter is written in C++.

Executable file of Autoit when interpreter that uncompleted as executable file in C++.

So Autoit's file compiled bigger C++ if they do same work. (include source file and interpreter is written in C++)

So Autoit using UPX for less size of it as the same perl2exe soft.

In Autoit isn't support Class and datatype enum. Most of function in Autoit is define from user (in include directory)

With struct datatype is inherit from Windows API and ???

I need answers true of false. Because, tomorrow I has a seminar about Autoit.

Thanks :)

Edited by Phstiger

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0