use for...to.. next in stead of for each..next
use for...to.. next in stead of for each..next
(OP)
hello everybody,
I would like to know how to use for...to.. next in stead of for each..next
for example :
I want the same result but with using For..To..Next
thank you all
I would like to know how to use for...to.. next in stead of for each..next
for example :
CODE -->
Set objFSO = CreateObject("Scripting.FileSystemObject") For Each objDrive In objFSO.Drives WScript.Echo objDrive.DriveLetter Next
I want the same result but with using For..To..Next
CODE -->
Set objFSO = CreateObject("Scripting.FileSystemObject") nn = objFSO.Drives.Count For i=1 to nn WScript.Echo ............. ' I want to get same result obove Next
thank you all
RE: use for...to.. next in stead of for each..next
RE: use for...to.. next in stead of for each..next
RE: use for...to.. next in stead of for each..next
CODE --> vbscript
RE: use for...to.. next in stead of for each..next
https://gallery.technet.microsoft.com/scriptcenter...
and
https://www.reliance-scada.com/en/support/articles...
RE: use for...to.. next in stead of for each..next
The problem here is that the item Index used for the FileSystemObject's Files collection is the filename, not a number, so we cannot use for ... next with it ...
But here's a question: do you have a good reason why you want to use For Next, or is it just a personal preference?
RE: use for...to.. next in stead of for each..next
thank you
RE: use for...to.. next in stead of for each..next
regards