Modify

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#2811 closed Feature Request (Completed)

VarGetType - Example - proposal

Reported by: mLipok Owned by: Melba23
Milestone: 3.3.13.11 Component: Documentation
Version: Severity: None
Keywords: Cc:

Description

#include <MsgBoxConstants.au3>
`#include <array.au3>

Local $aArray[2] = [1, "Example"]
Local $dBinary = Binary("0x00204060")
Local $bBoolean = False
Local $hFunc = ConsoleWrite
Local $pPtr = Ptr(-1)
Local $hWnd = WinGetHandle(AutoItWinGetTitle())
Local $iInt = 1
Local $fFloat = 2.0
Local $oObject = ObjCreate("Scripting.Dictionary")
Local $sString = "Some text"
Local $tStruct = DllStructCreate("wchar[256]")
Local $vKeyword = Default
Local $fu_Test = Test

MsgBox($MB_SYSTEMMODAL, "", _
		"Variable Types" & @CRLF & _
		"$aArray is an " & VarGetType($aArray) & " variable type." & @CRLF & _
		"$dBinary is a " & VarGetType($dBinary) & " variable type." & @CRLF & _
		"$bBoolean is a " & VarGetType($bBoolean) & " variable type." & @CRLF & _
		"$hFunc is a " & VarGetType($hFunc) & " variable type." & @CRLF & _
		"$pPtr is a " & VarGetType($pPtr) & " variable type." & @CRLF & _
		"$hWnd is a " & VarGetType($hWnd) & " variable type." & @CRLF & _
		"$iInt is an " & VarGetType($iInt) & " variable type." & @CRLF & _
		"$fFloat is a " & VarGetType($fFloat) & " variable type." & @CRLF & _
		"$oObject is a " & VarGetType($oObject) & " variable type." & @CRLF & _
		"$sString is a " & VarGetType($sString) & " variable type." & @CRLF & _
		"$tStruct is a " & VarGetType($tStruct) & " variable type." & @CRLF & _
		"$vKeyword is a " & VarGetType($vKeyword) & " variable type." & @CRLF & _
		"MsgBox is a " & VarGetType(MsgBox) & " variable type." & @CRLF & _
		"_ArrayAdd is a " & VarGetType(_ArrayAdd) & " variable type." & @CRLF & _
		"$fu_Test is a " & VarGetType($fu_Test) & " variable type." & @CRLF & _
		"Test is a " & VarGetType(Test) & " variable type." & @CRLF)

Func Test()
EndFunc

Attachments (1)

VarGetType.au3 (1.7 KB) - added by mLipok 6 years ago.

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by mLipok

comment:1 Changed 6 years ago by Melba23

A few minor changes - and I added Map as well.

M23

comment:2 Changed 6 years ago by Melba23

  • Milestone set to 3.3.13.11
  • Owner set to Melba23
  • Resolution set to Completed
  • Status changed from new to closed

Changed by revision [10476] in version: 3.3.13.11

comment:3 Changed 6 years ago by mLipok

This on looks beter:

#include <MsgBoxConstants.au3>

Local $aArray[2] = [1, "Example"]
Local $mMap[]
Local $dBinary = Binary("0x00204060")
Local $bBoolean = False
Local $pPtr = Ptr(-1)
Local $hWnd = WinGetHandle(AutoItWinGetTitle())
Local $iInt = 1
Local $fFloat = 2.0
Local $oObject = ObjCreate("Scripting.Dictionary")
Local $sString = "Some text"
Local $tStruct = DllStructCreate("wchar[256]")
Local $vKeyword = Default
Local $fuFunc = ConsoleWrite
Local $fuUserFunc = Test

MsgBox($MB_SYSTEMMODAL, "", _
		"Variable Types" & @CRLF & @CRLF & _
		"$aArray : " & @TAB & VarGetType($aArray) & " variable type." & @CRLF & _
		"$mMap : " & @TAB & @TAB & VarGetType($mMap) & " variable type." & @CRLF & _
		"$dBinary : " & @TAB & VarGetType($dBinary) & " variable type." & @CRLF & _
		"$bBoolean : " & @TAB & VarGetType($bBoolean) & " variable type." & @CRLF & _
		"$pPtr : " & @TAB & @TAB & VarGetType($pPtr) & " variable type." & @CRLF & _
		"$hWnd : " & @TAB & @TAB & VarGetType($hWnd) & " variable type." & @CRLF & _
		"$iInt : " & @TAB & @TAB & VarGetType($iInt) & " variable type." & @CRLF & _
		"$fFloat : " & @TAB & @TAB & VarGetType($fFloat) & " variable type." & @CRLF & _
		"$oObject : " & @TAB & VarGetType($oObject) & " variable type." & @CRLF & _
		"$sString : " & @TAB & VarGetType($sString) & " variable type." & @CRLF & _
		"$tStruct : " & @TAB & VarGetType($tStruct) & " variable type." & @CRLF & _
		"$vKeyword : " & @TAB & VarGetType($vKeyword) & " variable type." & @CRLF & _
		"MsgBox : " & @TAB & @TAB & VarGetType(MsgBox) & " variable type." & @CRLF & _
		"$fuFunc : " & @TAB & VarGetType($fuFunc) & " variable type." & @CRLF & _
		"Func 'Test' : " & @TAB & VarGetType(Test) & " variable type." & @CRLF & _
		"$fuUserFunc : " & @TAB & VarGetType($fuUserFunc) & " variable type.")

Func Test()
EndFunc   ;==>Test

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain Melba23.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.