Sign in to follow this  
Followers 0
bling8d

Display an array in gui

17 posts in this topic

Hello,

I just want to display my array in my gui, like in an edit button if it's possible? I've tried to set the data of the array in the button but it doesn't work and _ArrayDisplay shows a pop up and I don't want it. I can copy paste it maybe but I don't want to modify the clipboard of the user

Thank you

Share this post


Link to post
Share on other sites



I've tried to set the data of the array in the button but it doesn't work

Can you show the code of your script? Then it's easier to help you.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Yes sorry, so I have something like that for now

$test2=_IETableGetCollection($oie,1)
   $atabledata=_IETableWriteToArray($test2,true)
   _ArrayDelete($atabledata,0)
   GUICtrlSetData($Edit1,_ArrayDisplay($atabledata))

$edit1 is obviously an edit button, this return "1" (so succes) in the edit button and the array pops up. I've tried other thing but I don't even remember x)

Share this post


Link to post
Share on other sites

Use function _ArrayToString to convert the array to a string and then call GUICtrlSetData.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

$myarray=_ArrayToString($atabledata)
GUICtrlSetData($Edit1,$myarray)

This return nothing, I remember having try this and I couldn't do anything with the arrayToString function :/

If I try to consoleWryte $myarray nothing happens and if I make a msgBox It returns a box with nothing

Edited by bling8d

Share this post


Link to post
Share on other sites

You are sure that the array contains any data?

What's the value of @error after _ArrayToString?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Yes I'm sure because _arrayDisplay shows me the array full of data. The status of @error is 3 - $avArray is not an 1 dimensional array. So I need a 1D array? oO

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

You don't need a 1D array. You can create the string yourself:

Global $sData
For $iIndex1 = 0 To UBound($atabledata, 1) - 1
    For $iIndex2 = 0 To UBound($atabledata, 2) - 1
        $sData = $sData & $atabledata[$iIndex1][$iIndex2]
        If $iIndex2 <> UBound($atabledata, 2) - 1 Then $sData = $sData & "|"
    Next
    If $iIndex1 <> UBound($atabledata, 1) - 1 Then $sData = $sData & @CRLF
Next
Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Thank you for the code =) but how would I do if I want to print it as an array? I mean if I print the string it's kinda awful and I'd like to print the array with column etc

Share this post


Link to post
Share on other sites

In this case an Edit Control doesn't do what you need. Have a look at function GUICtrlCreateListView. The example script in the help file shows how it looks like and how it is to be filled.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Yep that's where I was just looking (: now I just need to know how to make it write all the lines and not only the first.

But I have another problem... Without any reason I get this

--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
--> IE.au3 V2.4-0 Error from function _IECreate (Browser Object Creation Failed)
--> IE.au3 V2.4-0 Error from function _IETableGetCollection, $_IEStatus_InvalidDataType
--> IE.au3 V2.4-0 Error from function _IETableWriteToArray, $_IEStatus_InvalidDataType

I didn't modify the code and the site is still up.. Any idea?

Share this post


Link to post
Share on other sites

No idea. Maybe a crashed instance of the IE floating around? I would recommend a restart of your computer.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Ow nevermind, I had like 25 process of IE xD I added _IEQuit (:

So to do what I want I should make a loop that will trim the string then put every line in the list with GUICtrlCreateListViewItem, am I on the right track?

Also is that possible do completely delete column of an array?

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

This fills the listview with columns 1 and 3 of your array dropping column 2.

$listview = GUICtrlCreateListView("col1 |col2|col3 ", 10, 10, 200, 150)
For $iIndex = 0 to UBound($aTableData, 1) - 1
    $sData = $aTableData[$iIndex][0] & "|" & $aTableData[$iIndex][2]
    $item1 = GUICtrlCreateListViewItem($sData, $listview)
Next

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Thank you buddy! =D

It works perfectly (:

Now I have to write all the data from my list to a file but how can I do that? I can't find a function to get the data from the list. I can GuiCtrlRead the list but Iit returns this: ListView Control identifier (controlID) of the selected ListViewItem. 0 means no item is selected so that's not really helpfull...

If I do this consolewrite(GUICtrlRead(GUICtrlRead($List1))) I get one line but I don't know how to select one particular line/all the lines

So I could make a loop with the code you've written and write each string ($sData) in the file but that's heavy =p I'm looking for a way to directly extract all the data from the listView

Share this post


Link to post
Share on other sites

I would stick with the loop:

Take my code from above and add

FileWriteLine("C:tempoutput.txt", $sData)
after
$sData = $aTableData[$iIndex][0] & "|" & $aTableData[$iIndex][2]

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

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