FindFirstFile
by Howard Dortch · in Torque Game Engine · 09/28/2005 (10:37 am) · 4 replies
Does findFirstFile get the last file aphabeticly in the directory first? If so is there a way to make it do acending?
I have a list of files and get it like so
for(%file = findFirstFile($Server::MissionFileSpec); %file !$= ""; %file = findNextFile($Server::MissionFileSpec))
{
SM_missionList.addRow(%i++, getMissionInfoString(%file) @ "\t" @ %file );
echo("on Wake "@getMissionInfoString(%file) @ "\t" @ %file);
This echo prints the names of the files from Z to A
I have a list of files and get it like so
for(%file = findFirstFile($Server::MissionFileSpec); %file !$= ""; %file = findNextFile($Server::MissionFileSpec))
{
SM_missionList.addRow(%i++, getMissionInfoString(%file) @ "\t" @ %file );
echo("on Wake "@getMissionInfoString(%file) @ "\t" @ %file);
This echo prints the names of the files from Z to A
#2
Another quirk is the SM_missionList::onSelect function, seems the top listing is a higher number than the last listing. If I have 4 items in the list and I select the top one which I assume is 0 or 1 depending on how you look at it it returns a 4 as the row value.
09/28/2005 (11:05 am)
SM_missionList is an array of sorts since I can index them.Another quirk is the SM_missionList::onSelect function, seems the top listing is a higher number than the last listing. If I have 4 items in the list and I select the top one which I assume is 0 or 1 depending on how you look at it it returns a 4 as the row value.
#3
you might want to try
09/28/2005 (11:12 am)
Hmm, if I remember correctly a list has a row value and an ID value (among a text one)... the id value is a specified one upon entering the data...you might want to try
ConsoleMethod( GuiTextListCtrl, sort, void, 3, 4, "(int columnID, bool increasing=false)"
"Performs a standard (alphabetical) sort on the values in the specified column.")
Torque 3D Owner Matthew Langley
Torque