Please forgive me but I am a big novice at this. I am trying to write some VBscript that will ask a series of questions to generate a csv file. I have got as far as being able to write one line to the CSV file but am having problems making it loop until the user wants to quit the program.
Here is what I have written so far. Please forgive the bad coding as I say I am very new to this:
dim filesys, filetxt, write
Const ForReading = 1, ForWriting = 2, ForAppending = 8
' trying to make a Do loop that will loop until 0 is entered on the first question but it does not work'
'do until intSFNumber = 0'
Dim intSFNumber: intSFNumber = CInt(InputBox("Enter Type of computer game: 1 for Amiga 2 for PC 3 for PS1 4 for ATARI ST", "Folder Number", 0))
If intSFNumber = 1 then
write = "amiga"
end if
If intSFNumber = 2 then
write = "pc"
end if
If intSFNumber = 3 then
write = "ps1"
end if
If intSFNumber = 4 then
write = "atarist"
end if
Dim GameName: GameName = (InputBox("Enter name of game"))
Set filesys = CreateObject("Scripting.FileSystemObject")
Set filetxt = filesys.OpenTextFile("C:\mycsv.csv", ForAppending, True)
filetxt.WriteLine(write & "," & GameName)
filetxt.Close
'loop'
2007-08-12
04:49:16
·
4 answers
·
asked by
haydnward
1