DjDeep00 Posted July 6, 2006 Posted July 6, 2006 Currently I can only have a maximum length of 1,023 characters for a listviewitem. Is this true?
marfdaman Posted July 6, 2006 Posted July 6, 2006 All I can say is that I ran into this as well, seems to be some kind of Windows limit Alzo Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tazdevil20 Posted June 7, 2007 Posted June 7, 2007 Hello, I have the same problem. I can only 260 characters write in one line with guictrlcreatelistviewitem. I need as minimum 340 characters. Can anyone help me?
GaryFrost Posted June 8, 2007 Posted June 8, 2007 Hello,I have the same problem. I can only 260 characters write in one line with guictrlcreatelistviewitem.I need as minimum 340 characters.Can anyone help me?260 is the amount that the listview shows in the item not what the item actually holds SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
randallc Posted June 8, 2007 Posted June 8, 2007 260 is the amount that the listview shows in the item not what the item actually holdsHi, i've nevebeen sure the exact natue of that 260 limit; do you mean1. number ot sub-items per listview item.2. number of characters prt subitem.3. number of characters of the first subitem of the item (ie of the "item" shwn as first on a ine wth the subpitems.)4. Is this documented anywhere I can read about it?5. Is there a limit on total number of characters in one item (ie sum of tem text plus subitems text ) in addition to the above.?I have not tested fully, but my impression before I wrote _Arraydisplay was that all was well ie no crash) if I limite the number of subitems to display to <260?Best, randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW
GaryFrost Posted June 8, 2007 Posted June 8, 2007 (edited) from msdnIf the structure receives item attributes, pszText is a pointer to a buffer that receives the item text. Note that although the list-view control allows any length string to be stored as item text, only the first 260 TCHARs are displayed. Edited June 8, 2007 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
GaryFrost Posted June 8, 2007 Posted June 8, 2007 I have the _GUICtrlListViewGetItemText set to get upto 4095 characters, and _GUICtrlListViewSetItemText length of text plus 1 SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
randallc Posted June 8, 2007 Posted June 8, 2007 (edited) hi, @gafrost There is some limit on the header display perhaps? Run my attached script for array display (internally I limit that to 250 columns), and it shows only about 207 (wider 259 items) or 211 (154 char items) columns; same if I write a new non-delimited script. What do you think? - character number in header plus header subitems? best, randall Edited June 9, 2007 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW
tazdevil20 Posted June 9, 2007 Posted June 9, 2007 Hello, if I export any lines in the Listview all characters are displayed in the file. I hoped there is any chance to show more then the 260 characters. Thanks for the answers.
randallc Posted June 9, 2007 Posted June 9, 2007 Hi, See @gafrosts's ref to Microsoft limitations; probably no help for you. Maybe post your array data; perhaps there is another way to display it?... Best, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW
tazdevil20 Posted June 10, 2007 Posted June 10, 2007 Hello, I create a ListView: $L_Console = GUICtrlCreateListView("|", 2, 275, 590, 204, BitOR($LVS_NOCOLUMNHEADER, $LVS_SINGLESEL, $WS_VSCROLL, $WS_HSCROLL), $LVS_EX_FLATSB) _GUICtrlListViewSetColumnWidth(-1, 0, 2500)oÝ÷ Ù8^§îËb¢{h¸z)⵫¢+ÙÕ¹}½¹Í½±ÝÉ¥Ñ ÀÌØí½¹Í½±°ÀÌØíÑáаÀÌØí½±½ÈôÁá¤(%¥ÀÌØíÑáбÐìÐìÅÕ½ÐìÅÕ½ÐìQ¡¸($$ÀÌØíÝÉ¥ÑôU% Ñɱ ÉÑ1¥ÍÑY¥Ý%Ñ´ ÀÌØíÑáаÀÌØí½¹Í½±¤($%U% ÑɱMÑ ½±½È ´Ä°ÀÌØí½±½È¤($$ÀÌØí½Õ¹Ðô}U% Ñɱ1¥ÍÑY¥ÝÑ%ѵ ½Õ¹Ð ÀÌØí½¹Í½±¤($%}U% Ñɱ1¥ÍÑY¥ÝMɽ±° ÀÌØí½¹Í½±°À°ÈÀÀ¤(%¹%)¹Õ¹oÝ÷ Ø Ýiû§rبÚ,j÷Xzk"+ZºÚ"µÍ[ÈØÛÛÛÛØ]J ÌÍØÛÛÛÛK ÌÍÜØ]WÙ[JBZYÝ[ÔYÚ ÌÍÜØ]WÙ[K H ÉÝÈ ][ÝËÙÉ][ÝÈ[BIÌÍÜØ]WÙ[HH ÌÍÜØ]WÙ[H [È ][ÝËÙÉ][ÝÂQ[YBZY[Q^ÝÊ ÌÍÜØ]WÙ[JH[BIÌÍÝYXØÚZXHÙÐÞ Í ][ÝÑ]ZH^ÝY ][ÝË ][ÝÔÛÛYH]ZH ][ÝÈ [È ÌÍÜØ]WÙ[H [È ][ÝÈ?ØÚYX[Ù[É][ÝÊBBZY ÌÍÝYXØÚZXH [BBYØXJ BBBIÌÍÙ[HH[SÜ[ ÌÍÜØ]WÙ[KBBBIÌÍØÛÝ[HÑÕRPÝÝY]ÑÙ]][PÛÝ[ ÌÍØÛÛÛÛJBBBYÜ ÌÍÚHHÈ ÌÍØÛÝ[LBBBBIÌÍÛ[HHÑÕRPÝÝY]ÑÙ]][U^ ÌÍØÛÛÛÛK ÌÍÚJBBBBQ[UÜ]S[J ÌÍÙ[K ÌÍÛ[JBBBS^BBWØÛÛÛÛ]Ü]J ÌÍÓÐÛÛÛÛK ][ÝÓÙÈÝHXÚ ][ÝÈ [È ÌÍÜØ]WÙ[H [È ][ÝÈÙÜZXÚ][ÝË ÌÍÙÜY[BBBQ[PÛÜÙJ ÌÍÙ[JBBQ[ÙBBBWØÛÛÛÛ]Ü]J ÌÍÓÐÛÛÛÛK ][ÝÔÜZXÚÈÙÜÈÝHXÙXØÚ[][ÝÊBBQ[YQ[ÙBBYØXJ BBIÌÍÙ[HH[SÜ[ ÌÍÜØ]WÙ[KBBIÌÍØÛÝ[HÑÕRPÝÝY]ÑÙ]][PÛÝ[ ÌÍØÛÛÛÛJBBYÜ ÌÍÚHHÈ ÌÍØÛÝ[LBBBIÌÍÛ[HHÑÕRPÝÝY]ÑÙ]][U^ ÌÍØÛÛÛÛK ÌÍÚJBBBQ[UÜ]S[J ÌÍÙ[K ÌÍÛ[JBBS^BWØÛÛÛÛ]Ü]J ÌÍÓÐÛÛÛÛK ][ÝÓÙÈÝHXÚ ][ÝÈ [È ÌÍÜØ]WÙ[H [È ][ÝÈÙÜZXÚ][ÝË ÌÍÙÜY[BBQ[PÛÜÙJ ÌÍÙ[JBQ[YY[XJ B[[ I have 1 Item that is longer as 260 characters. This is not really badly for me but a little unbeautiful.
randallc Posted June 10, 2007 Posted June 10, 2007 Hi, So why not show a working script to se the problem? Best, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW
tazdevil20 Posted June 10, 2007 Posted June 10, 2007 ok, ok Here is a example script. I need a ListView, because i need the backgroundcolor for some items. expandcollapse popup#include <GUIConstants.au3> #Include <GuiListView.au3> $red = 0xff0000 $green = 0x00FF40 $Form1 = GUICreate("Form1", 630, 262, 193, 115) $b_write = GUICtrlCreateButton("Write", 100, 224, 100, 30, $BS_FLAT) $b_save = GUICtrlCreateButton("Save", 300, 224, 100, 30, $BS_FLAT) $L_Console = GUICtrlCreateListView("|", 0, 32, 626, 182, BitOR($LVS_NOCOLUMNHEADER, $LVS_SINGLESEL, $WS_VSCROLL, $WS_HSCROLL), $LVS_EX_FLATSB) _GUICtrlListViewSetColumnWidth(-1, 0, 2500) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $b_write _consolewrite($L_Console, "This is a example text that is longer as 260 characters. -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 260123456789") Case $b_save $logfile = FileSaveDialog("Log speichern", @ScriptDir, "Log-Datei (*.log)") if Not @error Then _consolesave($L_Console, $logfile) EndSwitch WEnd Func _consolewrite($console, $text, $color = 0xffffff) if $text <> "" Then $write = GUICtrlCreateListViewItem($text, $console) GUICtrlSetBkColor(-1, $color) $count = _GUICtrlListViewGetItemCount($console) _GUICtrlListViewScroll($console,0,200) EndIf EndFunc Func _consolesave($console, $save_file) if StringRight($save_file, 4) <> ".log" Then $save_file = $save_file & ".log" EndIf if FileExists($save_file) Then $ueberschreib = MsgBox(36, "Datei existiert", "Soll die Datei " & $save_file & " überschrieben werden?") if $ueberschreib = 6 Then $file = FileOpen($save_file, 2) $count = _GUICtrlListViewGetItemCount($console) for $i = 0 to $count -1 $line = _GUICtrlListViewGetItemText($console, $i) FileWriteLine($file, $line) Next _consolewrite($L_Console, "Log wurde nach " & $save_file & " gespeichert.", $green) FileClose($file) Else _consolewrite($L_Console, "Speichern des Logs wurde abgebrochen.") EndIf Else $file = FileOpen($save_file, 2) $count = _GUICtrlListViewGetItemCount($console) for $i = 0 to $count -1 $line = _GUICtrlListViewGetItemText($console, $i) FileWriteLine($file, $line) Next _consolewrite($L_Console, "Log wurde nach " & $save_file & " gespeichert.", $green) FileClose($file) EndIf EndFunc
randallc Posted June 10, 2007 Posted June 10, 2007 Hi, I cannot get alternate colours to wrk, but just display the rest of the line in the next column? _GUICtrlListViewSetColumnWidth($L_Console, 0, 259 * 7 - 198)oÝ÷ Ûû-®)lº·ºÚ"µÍÌÍÝÜ]HHÕRPÝÜX]SÝY]Ò][J ÌÍÝ^ [È ][Ýß ][ÝÈ [ÈÝ[ÓZY ÌÍÝ^ K ÌÍØÛÛÛÛJBest, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW
tazdevil20 Posted June 10, 2007 Posted June 10, 2007 Hello, thanks for the tip! I change my script to this expandcollapse popup#include <GUIConstants.au3> #Include <GuiListView.au3> $red = 0xff0000 $green = 0x00FF40 $Form1 = GUICreate("Form1", 630, 262, 193, 115) $b_write = GUICtrlCreateButton("Write", 100, 224, 100, 30, $BS_FLAT) $b_save = GUICtrlCreateButton("Save", 300, 224, 100, 30, $BS_FLAT) $L_Console = GUICtrlCreateListView("| |", 0, 32, 626, 182, BitOR($LVS_NOCOLUMNHEADER, $LVS_SINGLESEL, $WS_VSCROLL, $WS_HSCROLL), $LVS_EX_FLATSB) GUISetState(@SW_SHOW) _consolewrite($L_Console, "jdfölkjsf", $green) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $b_write _consolewrite($L_Console, "This is a example text that is longer as 260 characters. -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 260123456789") Case $b_save $logfile = FileSaveDialog("Log speichern", @ScriptDir, "Log-Datei (*.log)") if Not @error Then _consolesave($L_Console, $logfile) EndSwitch WEnd Func _consolewrite($console, $text, $color = 0xffffff) if $text <> "" Then If StringLen($text) > 260 then $write = GUICtrlCreateListViewItem($text & "|" & StringMid($text, 260), $console) Else $write = GUICtrlCreateListViewItem($text, $console) GUICtrlSetBkColor(-1, $color) $count = _GUICtrlListViewGetItemCount($console) _GUICtrlListViewScroll($console,0,200) EndIf EndIf _GUICtrlListViewSetColumnWidth($L_Console, 0, $LVSCW_AUTOSIZE) _GUICtrlListViewSetColumnWidth($L_Console, 1, $LVSCW_AUTOSIZE) EndFunc Func _consolesave($console, $save_file) if StringRight($save_file, 4) <> ".log" Then $save_file = $save_file & ".log" EndIf if FileExists($save_file) Then $ueberschreib = MsgBox(36, "Datei existiert", "Soll die Datei " & $save_file & " überschrieben werden?") if $ueberschreib = 6 Then $file = FileOpen($save_file, 2) $count = _GUICtrlListViewGetItemCount($console) for $i = 0 to $count -1 $line = _GUICtrlListViewGetItemText($console, $i, 0) FileWriteLine($file, $line) Next _consolewrite($L_Console, "Log wurde nach " & $save_file & " gespeichert.", $green) FileClose($file) Else _consolewrite($L_Console, "Speichern des Logs wurde abgebrochen.") EndIf Else $file = FileOpen($save_file, 2) $count = _GUICtrlListViewGetItemCount($console) for $i = 0 to $count -1 $line = _GUICtrlListViewGetItemText($console, $i, 0) FileWriteLine($file, $line) Next _consolewrite($L_Console, "Log wurde nach " & $save_file & " gespeichert.", $green) FileClose($file) EndIf EndFunc If a line is longer as 260 characters then the text is split to 2 strings and written in a new column. This is nearly perfect. There are some spaces after the first column if the text is longer as 260 characters.
randallc Posted June 10, 2007 Posted June 10, 2007 Hi, I cannot get alternate colours to wrk, but just display the rest of the line in the next column? _GUICtrlListViewSetColumnWidth($L_Console, 0, 259 * 7 - 198)oÝ÷ Ûû-®)lº·ºÚ"µÍÌÍÝÜ]HHÕRPÝÜX]SÝY]Ò][J ÌÍÝ^ [È ][Ýß ][ÝÈ [ÈÝ[ÓZY ÌÍÝ^ K ÌÍØÛÛÛÛJBest, RandallGood! See deleted line above to minimise the spaces? Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW
tazdevil20 Posted June 10, 2007 Posted June 10, 2007 This is a limit from the listview. If I make the column a little smaller, the text ends with "...".
randallc Posted June 11, 2007 Posted June 11, 2007 (edited) yes, less spaces if you split it? Edited June 11, 2007 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now