Jump to content

Get value from one Array Table


Recommended Posts

Hello,

I have this array table :
 

#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Form2", 171, 179, 302, 218)
$ListView1 = GUICtrlCreateListView("MyID|MyEmail|MyPAssword", 0, 0, 169, 177)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 50)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 50)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 70)
$ListView1_0 = GUICtrlCreateListViewItem("102|test@mailcom|Pass1", $ListView1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

How can i get Email value please ?

And how to assign value ?

Thank you

Link to comment
Share on other sites

  • Moderators
58 minutes ago, AutoDEV said:

Hello,

I have this array table :
 

#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Form2", 171, 179, 302, 218)
$ListView1 = GUICtrlCreateListView("MyID|MyEmail|MyPAssword", 0, 0, 169, 177)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 50)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 50)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 70)
$ListView1_0 = GUICtrlCreateListViewItem("102|test@mailcom|Pass1", $ListView1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

How can i get Email value please ?

And how to assign value ?

Thank you

Am I missing something here (other than zero code that shows an attempt)?

Are we to assume you want us to write the code to read the column into an array, that you have a magical array that you've already extracted and don't know how to enum the values, that you don't understand a function that reads the column and row values from the listview?

Right there I've nearly added more information than the copy and paste script you provided from Koda.

Do yourself a favor, when I googled your question with "Site: AutoIt" and used the term listview into array, I found NUMEROUS values... try that.

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.

Link to comment
Share on other sites

You can do something like this to read the first email or select an item from listview and press the button to read the selected email:

#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Form2", 250, 250, 302, 218)
$ListView1 = GUICtrlCreateListView("MyID|MyEmail|MyPAssword", 0, 0, 250, 180)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 50)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 50)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 70)
$ListView1_0 = GUICtrlCreateListViewItem("102|test@mailcom|Pass1", $ListView1)
$ListView2_0 = GUICtrlCreateListViewItem("103|another@mailcom|Pass2", $ListView1)
$cRead = GUICtrlCreateButton('Read selected email', 50, 200, 150, 30)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

$aSplit = StringSplit(GUICtrlRead($ListView1_0), '|')
MsgBox(0, 'First email', $aSplit[2])

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $cRead
            $aSplit = StringSplit(GUICtrlRead(GUICtrlRead($ListView1)), '|')
            MsgBox(0, 'Selected email', $aSplit[2])
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

 

When the words fail... music speaks.

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...