|< 1 2 >| | 12 Einträge, 2 Seiten |
QuoteDim A(10)
Although the number shown in the parentheses is 10, all arrays in VBScript are zero-based, so this array actually contains 11 elements. In a zero-based array, the number of array elements is always the number shown in parentheses plus one. This kind of array is called a fixed-size array.
You assign data to each of the elements of the array using an index into the array. Beginning at zero and ending at 10, data can be assigned to the elements of an array as follows:
A(0) = 256
A(1) = 324
A(2) = 100
. . .
A(10) = 55
1
2
3
4
5
6
7
8
9
10
11
Function GetFolderList(folderspec)
Dim fso, f, f1, fc, s
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(folderspec)
Set fc = f.Files
For Each f1 in fc
s = s & f1.name
s = s & "\n"
Next
GetFolderList = s
End Function
QuoteDim NotFound (100), Found (100)
Dim NotFoundIndex, FoundIndex
NotFoundIndex = 0
FoundIndex = 0
' .... down the road
If found = 1 Then
'WScript.Echo "[" & data.title & "] has been found"
Found(FoundIndex) = data.title
FoundIndex = FoundIndex + 1
Else
'WScript.Echo " ! [" & data.title & "] has NOT been found"
NotFound(NotFoundIndex) = data.title
NotFoundIndex = NotFoundIndex + 1
End If
|< 1 2 >| | 12 Einträge, 2 Seiten |