Posted: Tue Sep 17, 2013 11:19 am Post subject: How to get text of subitems
Hey there,
How can I get the text of subitems of an listitem object? (In ListView).
Code:
function Data:PraseData(Table)
-- few steps before..
for i=#Table,1,-1 do -- appending from the last to the first, since there's no autoscroll in ListView
self[2][i] = {};
self[2][i][1] = self.ListVI.add();
self[2][i][1].Caption = Table[i][1];
self[2][i][2] = self[2][i][1].getSubItems();
self[2][i][2].cul1 = self[2][i][2].add("String1"); --Not the actual string, just as a example
self[2][i][2].cul2 = self[2][i][2].add("String2"); --Not the actual string, just as a example
end
-- few steps after..
end
Joined: 09 May 2003 Posts: 25830 Location: The netherlands
Posted: Tue Sep 17, 2013 11:34 am Post subject:
SubItems is a Strings object
Code:
Strings Class: (Inheritance : Object) (Mostly an abstract class)
properties
Text : String - All the strings in one string
Count: Integer - The number of strings in this list
String[]: String - Array to access one specific string in the list
[] = String[]
methods
clear() : Deletes all strings in the list
add(string) : adds a string to the list
delete(index) : Deletes a string from the list
getText() : Returns all the strings as one big string
setText() : Sets the strings of the given strings object to the given text (can be multiline)
indexOf(string): Returns the index of the specified string. Returns -1 if not found
insert(index, string): Inserts a string at a specific spot moving the items after it
getCount(): Returns the number is strings in the list
remove(string); Removes the given string from the list
loadFromFile(filename) : Load the strings from a textfile
saveToFile(filename) : Save the strings to a textfile
getString(index) : gets the string at the given index
setString(index, string) : Replaces the string at the given index
the Text property returns all the strings in one line
You want to use the line specific one
either [] or String[] or getString()
not sure if I fixed [] in the release but try
Code:
print(Data[2][1][2][0])
else
Code:
print(Data[2][1][2].String[0])
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum