abood1987 escribió:
hi
dowsher
On
Refresh Button the
right code is :
result = ComboBox.GetCount("ComboBox1");
while (result > 0) do
ComboBox.DeleteItem("ComboBox1", 1);
result = ComboBox.GetCount("ComboBox1");
end
ComboBox.AddItem("ComboBox1", "->Elija su unidad", "");
ComboBox.SetSelected("ComboBox1", 1);
............................................................................
look at the line
14 and
15 and
18 what is happened
Hi abood1987.
Agradezco mucho tu ayuda pero el script que has publicado no es correcto, segun
Help AMS
La unica forma de que
Drive.GetInformation devuelva
nil es que no haya un disco en la unidad de CD-ROM:
Offtopic:
Note: If the target drive is a CD-ROM drive or floppy drive, there must be a disk in the drive for this action to work. If there is no disk in the drive, nil is returned.
Yo descarto las unidades de CD-ROM y de disco flexible con:
sDrives = Drive.GetType(sDriver);
if (sDrives == DRIVE_REMOVABLE) then
.....................................................
y con esto
Drive.GetInformation no puede devolver
nil.
En todo caso entonces el código seria así.
result = ComboBox.GetCount("ComboBox1");
while (result > 0) do
ComboBox.DeleteItem("ComboBox1", 1);
result = ComboBox.GetCount("ComboBox1");
end
ComboBox.AddItem("ComboBox1", "->Elija su unidad", "");
ComboBox.SetSelected("ComboBox1", 1);
drives = Drive.Enumerate();
for x, sDriver in pairs (drives) do
sDrives = Drive.GetType(sDriver);
if (sDrives == DRIVE_REMOVABLE) then
sDrives = Drive.GetInformation(sDriver);
sDriver = String.Replace(sDriver, "\\", "");
if sDrives.Label == "" then
String.Replace(sDriver, "\\", "");
Dialog.Message("", 1);
ComboBox.AddItem("ComboBox1", "Disco extraíble ("..sDriver..")", sDriver);
else
Dialog.Message("", 2);
ComboBox.AddItem("ComboBox1", sDrives.Label.." ("..sDriver..")", sDriver);
end
end
end
De cualquier forma agradezco que quisieras ayudar
abood1987