Jump to content
Sign in to follow this  
Jon

AutoIt v3.3.13.4 Beta

Recommended Posts

and for the future 

UDF standards for variable name must be expanded for $tbl........


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API Forum Rules *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

11

Signature last update: 2018-10-31

Share this post


Link to post
Share on other sites

What about this??

#AutoIt3Wrapper_Run_Au3Check=N
#AutoIt3Wrapper_Version=B
Global $tblApple[]
$tblApple.Name = "Apple"
$tblApple.Color = "Blue"
$tblApple.Price = 10

Global $tblOrange[]
$tblOrange.Name = "Orange"
$tblOrange.Color = "Green"
$tblOrange.Price = 7

Global $tblBanana[]
$tblBanana.Name = "Banana"
$tblBanana.Color = "Red"
$tblBanana.Price = 13

Global $tblFruits[]
$tblFruits.Apple = $tblApple
$tblFruits.Orange = $tblOrange
$tblFruits.Banana = $tblBanana

ConsoleWrite($tblFruits.Apple.Color & @CRLF)
ConsoleWrite($tblFruits.Apple.Name & @CRLF)
ConsoleWrite($tblFruits.Apple.Price & @CRLF)

ConsoleWrite(@CRLF)

ConsoleWrite($tblFruits.Banana["Color"] & @CRLF)
ConsoleWrite($tblFruits.Banana["Name"] & @CRLF)
ConsoleWrite($tblFruits["Banana"]["Price"] & @CRLF)

ConsoleWrite(@CRLF)

ConsoleWrite($tblFruits.Orange.Color & @CRLF)
ConsoleWrite($tblFruits["Orange"]["Name"] & @CRLF)
ConsoleWrite($tblFruits["Orange"].Price & @CRLF)

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_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()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_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()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites

Or how about level 3 (Inception?)

#AutoIt3Wrapper_Run_Au3Check=N
#AutoIt3Wrapper_Version=B
Global $tblApple[]
$tblApple.Name = "Apple"
$tblApple.Color = "Blue"
$tblApple.Price = 10

Global $tblOrange[]
$tblOrange.Name = "Orange"
$tblOrange.Color = "Green"
$tblOrange.Price = 7

Global $tblFruits[]
$tblFruits.Apple = $tblApple

$tblFruits.Apple.Color = $tblOrange
$tblFruits.Apple.Price = $tblApple

ConsoleWrite($tblFruits.Apple.Color.Name & @CRLF)
ConsoleWrite($tblFruits.Apple.Color.Color & @CRLF)
ConsoleWrite($tblFruits.Apple.Color.Price & @CRLF)

ConsoleWrite($tblFruits["Apple"]["Price"]["Name"] & @CRLF)
ConsoleWrite($tblFruits["Apple"]["Price"]["Color"] & @CRLF)
ConsoleWrite($tblFruits["Apple"]["Price"]["Price"] & @CRLF)

This is quite cool, but quite difficult to read at first glance. I will more than likely use it as I would a dictionary structure.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_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()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_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()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites

Hard crash with first assigning a table to an element of an array then assigning back this element to a flat variable:

Local $tbl[]
$tbl.first = "begin"    ; optional to cause a crash

Local $var[3] = [1, $tbl, 3]
Local $x = $var[1]      ; causes a hard crash

Execute(), _ArrayDisplay() and probably others also cause a hard crash, like report below by ripdad says.

Edited by jchd

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)

Share this post


Link to post
Share on other sites

Also (unless I missed something in today's avalanche) and while it's nice to be able to iterate within keys or items, we don't have any way to enumerate both keys and corresponding items, well unless we store keys in a separate array then loop thru items to list both at the same time.

I feel .key() and .item() methods would alleviate the issue.

EDIT: forget it, I missed the announce of .keys(), my bad.

Edited by jchd

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)

Share this post


Link to post
Share on other sites

jchd,

Am I mistaken by what you mean?

Local $mTable[]
$mTable["One"] = 1
$mTable["Two"] = 2
$mTable["Three"] = 3

For $sKey In $mTable.Keys()
    ConsoleWrite($sKey & " => " & $mTable[$sKey] & @CRLF)
Next

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_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()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_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()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites

Ha, it was .keys()

Thanks

Does the code crash for you as well?


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)

Share this post


Link to post
Share on other sites

Assigning a new or existing object to a new or existing table element using dot notation fails with @error = 2

Once correctly created it is nonetheless possible to use dot notation to read it back.

Local $t[]

$t["Whatever"] = ObjCreate("scripting.dictionary")    ; OK
$t.whatever = ObjCreate("scripting.dictionary")        ; failure
If @error Then ConsoleWrite("error = " & @error & @LF)
$t["whatEver"] = ObjCreate("scripting.dictionary")    ; OK
$t.Whatever = ObjCreate("shell.application")        ; failure
If @error Then ConsoleWrite("error = " & @error & @LF)
Local $obj = ObjCreate("shell.application")
$t.WhatEver = $obj                                    ; failure
If @error Then ConsoleWrite("error = " & @error & @LF)

ConsoleWrite("$t.Whatever = " & VarGetType($t.Whatever) & " --> " & ObjName($t.Whatever) & @LF)    ; OK

For $k In $t.keys()
    ConsoleWrite($k & " --> " & VarGetType($t[$k]) & " " & ObjName($t[$k]) & @LF)
Next

AFAICT every other datatype works as expected:

Local $tbl[]
Local $typ3 = [4, 5, 6]
Local $table[]
$table.first = 123

$tbl["String"] = "to be table or not?"
$tbl.string = "to be table or not?"
$tbl["Int32"] = 123456
$tbl.int32 = 123456
$tbl["Int64"] = 123456789012345
$tbl.int64 = 123456789012345
$tbl["Double"] = 3.1415926
$tbl.double = 3.1415926
$tbl["Binary"] = Binary(987654321)
$tbl.binary = Binary(987654321)
$tbl[666] = "Belzebuth"
$tbl["Please_answer_my_question"] = "... waiting!"
$tbl.please_answer_my_question = "... waiting!"
$tbl["Array"] = $typ3
$tbl.array = $typ3
$tbl["Object"] = ObjCreate("shell.application")
$tbl.object = ObjCreate("shell.application")
If @error Then ConsoleWrite("error = " & @error & @LF)
$tbl["Null"] = Null
$tbl.null = Null
$tbl["Default"] = Default
$tbl.default = Default
$tbl["Boolean"] = (1 = 1)
$tbl.boolean = (1 = 1)
$tbl["Function"] = _VarDump
$tbl.function = _VarDump
$tbl["Ptr"] = Ptr(123456789)
$tbl.ptr = Ptr(123456789)
$tbl["Hwnd"] = WinGetHandle("AutoIt Help")
$tbl.hwnd = WinGetHandle("AutoIt Help")
$tbl["Dllstruct"] = DllStructCreate("int;double[2]")
$tbl.dllstruct = DllStructCreate("int;double[2]")
$tbl["Table"] = $table
$tbl.table = $table
Edited by jchd

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)

Share this post


Link to post
Share on other sites

Sorry for multi-posts, but don't try this (it hangs a core):

;~ $tbl["InitArray"][3] = [7, 8, 9]
;~ $tbl.initarray[3] = [7, 8, 9]

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)

Share this post


Link to post
Share on other sites

Jon,

I can reproduce ripdad's crash. It is not _ArrayDisplay failing - it seems you cannot extract a Map from within an array - nor an array or a Map from within a Map:

#AutoIt3Wrapper_Run_AU3Check=n

; Base array
Local $aArray[3] = ["A", "B", "C"]

; Base map
Local $mMap[]
$mMap["first"] = "begin"
ConsoleWrite("Just checking: " & $mMap["first"] & @CRLF & @CRLF)

; Add both to container array
Local $aContainer_Array[4] = [0, $aArray, $mMap, 3]

; Add both to container Map
Local $mContainer_Map[]
$mMap["Map"] = $mMap
$mMap["Array"] = $aArray

; Extract array from container array
ConsoleWrite("Extracting array from array" & @CRLF)
$vTmp = $aContainer_Array[1]
ConsoleWrite("Array extracted" & @CRLF)
ConsoleWrite("Array read: " & $vTmp[0] & @CRLF & @CRLF) ; This works

; Extract array from container map
ConsoleWrite("Extracting array from Map" & @CRLF)
$vTmp = $mContainer_Map["Array"]
ConsoleWrite("Array extracted" & @CRLF)
If IsArray($vTmp) Then
    ConsoleWrite("Array read: " & $vTmp[0] & @CRLF & @CRLF)
Else
    ConsoleWrite("But cannot be read" & @CRLF & @CRLF) ; But not this...
EndIf

ConsoleWrite("Extracting Map from Map" & @CRLF)
$vTmp = $mContainer_Map["Map"]
ConsoleWrite("Map extracted" & @CRLF)
If IsTable($vTmp) Then
    ConsoleWrite("Map read: " & $vTmp["first"] & @CRLF & @CRLF)
Else
    ConsoleWrite("But cannot be read" & @CRLF & @CRLF) ; ...not this
EndIf


ConsoleWrite("Extracting Map from array" & @CRLF)
$vTmp = $aContainer_Array[2]                               ; And this crashes <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
ConsoleWrite("Map extracted" & @CRLF)
ConsoleWrite("Map read: " & $vTmp["first"] & @CRLF & @CRLF
Can others please check the code and confirm their results. :)

M23

Edited by Melba23
Expanded code

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

I already started updating my scripts to use this new feature where possible, feels like power :P

Not a great idea, it may change syntax a lot...

Jon, I hope this bug reports don't disappoint you. Yes, this table type has some bugs and needs some extra works to be stable, but honestly, it's good enough even right now.

Thanks for the time you put on this, I understand that you won't get anything in return, so, thanks a lot.

Trancexx did most of the initial work ages ago. But I have just spent the last week recoding it and trying to get it working like I wanted (and no doubt nothing like she wanted). I'm not sure I've succeeded yet. 

Share this post


Link to post
Share on other sites

Seems like there is a little problem in Table type and Static declaration:
 

Foo()
Foo()
Foo()

Func Foo()
    Local Static $i = 0
    $i += 1

    Local Static $tblTest[]
    MsgBox(0, $i & "st call", $tblTest.Bar) ;It must be blank only in the first call to Foo()

    $tblTest.Bar = "Hello world!"
    ;MsgBox(0, $i & "st call", $tblTest.Bar) ;Check to make sure "Hello world!" is assinged to $tblTest.Bar
EndFunc

Share this post


Link to post
Share on other sites

Jon,

I can reproduce ripdad's crash. It is not _ArrayDisplay failing - it seems you cannot extract a Map from within an array - nor an array or a Map from within a Map:

 

There's a bug in your code:

; Add both to container Map
Local $mContainer_Map[]
$mMap["Map"] = $mMap
$mMap["Array"] = $aArray

should be:

; Add both to container Map
Local $mContainer_Map[]
$mContainer_Map["Map"] = $mMap
$mContainer_Map["Array"] = $aArray

I've fixed the hard crash. :)

Share this post


Link to post
Share on other sites

Jon,

Apologies for that. :>

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

 

Assigning a new or existing object to a new or existing table element using dot notation fails with @error = 2

Once correctly created it is nonetheless possible to use dot notation to read it back.

Fixed.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×
×
  • Create New...