1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| Sub LoadCustomer
cpt = 0
dim filesys, text, readfile, contents
set filesys = CreateObject("Scripting.FileSystemObject")
set readfile = filesys.OpenTextFile("ListCustomer.txt", 1, false)
Set oOption = Document.createElement("OPTION")
lstDynCustomer.Add(oOption)
do while readfile.AtEndOfStream=false
contents = readfile.ReadLine
cpt = cpt + 1
loop
readfile.close
For i = 1 to cpt
Set oOption = Document.createElement("OPTION")
oOption.Text = ReadFunction("ListCustomer.txt",i)
oOption.Value = ReadFunction("ListCustomer.txt",i)
lstDynCustomer.Add(oOption)
next
End Sub
Function ReadFunction(file,line)
'dim filesys, text, readfile, contents
set filesys = CreateObject("Scripting.FileSystemObject")
set readfile = filesys.OpenTextFile(file, 1, false)
for j = 1 to line
contents = readfile.ReadLine
next
readfile.close
ReadFunction = contents
End Function |
Partager