Jump to content

Columnwidth of _ArrayDisplay not proper


Recommended Posts

Hi all,

I'm a newbie in AutoIt and struggle with the following:

I use _FileReadToArray to read a comma seperated textfile, with 3 columns (i.c. 2 comma's per line)

When I use _ArrayDisplay to display this array, I'll see only two columns (one with the recordnumber and second the whole textline; this is not a problem)

The problem is, that default the column (col 0) is much to small to display the text.

How can I make this column wider, so the text is displayed well? I don't think I must edit the Array.au3?

Or am I doing something wrong?

Dim $aRecords
If Not _FileReadToArray("test.csv",$aRecords) Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf
_ArrayDisplay($aRecords, "Labels")

Thanks for help in advance.

Greetings,

Kebas

The Netherlands.

post-35882-1215633845_thumb.jpg

Link to comment
Share on other sites

_FileReadToArray splits each line of the file based on this code:

$aArray = StringSplit($sTemp, @CRLF, 1)
If @error Then $aArray = StringSplit($sTemp, @LF)
If @error Then $aArray = StringSplit($sTemp, @CR)
If you want to split within a line based on the comma as the delimiter - you will have to roll your own code.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Thanks!

But will this also solve the problem of the column widths?

Nope.

jvnorris may be correct - _ArrayDisplay may primarily be for debugging code. That is all that I've ever used it for and I don't know enough about GUI functions to modify it.

Maybe Gary (the author of the UDF) can stop by this thread and confirm.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Nope.

jvnorris may be correct - _ArrayDisplay may primarily be for debugging code. That is all that I've ever used it for and I don't know enough about GUI functions to modify it.

Maybe Gary (the author of the UDF) can stop by this thread and confirm.

Thank you all for your reply. I'll try to find a solution.

Link to comment
Share on other sites

Thank you all for your reply. I'll try to find a solution.

Solved!

After the line

GUICtrlCreateListViewItem($avArrayText[$i], $hListView)

you must add the following:

GUICtrlSendMsg($hListView, $LVM_SETCOLUMNWIDTH, 1, 390)

where the last digit is the columnwidth.

Edited by Kebas
Link to comment
Share on other sites

Nope.

jvnorris may be correct - _ArrayDisplay may primarily be for debugging code. That is all that I've ever used it for and I don't know enough about GUI functions to modify it.

Maybe Gary (the author of the UDF) can stop by this thread and confirm.

Although I didn't write the function I believe it's main purpose was for debugging.

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

Although I didn't write the function I believe it's main purpose was for debugging.

My bad - I got off by a line:
; Author ........: randallc, Ultima
; Modified.......: Gary Frost (gafrost) / Ultima: modified to be self-contained (no longer depends on "GUIListView.au3")
Thanks for stopping by. :-)

[size="1"][font="Arial"].[u].[/u][/font][/size]

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