Jump to content

Display an array in gui


Recommended Posts

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

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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)

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

$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
Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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?

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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?

Link to comment
Share on other sites

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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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
 Share

  • Recently Browsing   0 members

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