Saving Files with Web App

The code below is for saving a file generated by a web app. The app will be running stand alone on a local computer, and this code is in a Save Button Action event.

Dim f as new folderitem(SaveDialog.FileName.Text)
Dim t as textoutputstream
'f = getsavefolderitem(filetypes1.text, “*.txt”)
'If f <> Nil then
t = textoutputstream.create(f)
For K = 0 to 7
If Design.ID(K).Text > “” Then
t.writeline HVACData(1,K) +"," + HVACData(2,K) +","+ HVACData(3,K) +","+ HVACData(4,K) +","+ HVACData(5,K) +","+ HVACData(6,K) +","+ HVACData(7,K) +","+ HVACData(8,K) +","+ HVACData(9,K) +","+ HVACData(10,K) +","+ HVACData(11,K) +","+ HVACData(12,K) +","+ HVACData(13,K) +","+ HVACData(14,K) +","+ HVACData(15,K) +","+ HVACData(16,K) +","+ HVACData(17,K) +","+ HVACData(18,K)
Else
Exit For
End If
Next
t.writeline FieldData(1) +","+ FieldData(2) +","+ FieldData(3) +","+ FieldData(4) +","+ FieldData(5) +","+ FieldData(6) +","+ FieldData(7) +","+ FieldData(8) +","+ FieldData(9) +","+ FieldData(10) +","+ FieldData(11) +","+ FieldData(12) +","+ FieldData(13) +","+ FieldData(14) +","+ FieldData(15) +","+ FieldData(16)
For K = 0 to 7
If Design.ID(K).Text > “” Then
t.writeline Energy.StmFld(0,K) +","+ Energy.StmFld(1,K) +","+ Energy.StmFld(2,K) +","+ Energy.StmFld(3,K) +","+ Energy.StmFld(4,K) +","+ Energy.StmFld(5,K) +","+ Energy.StmFld(6,K) +","+ Energy.MistFld(0,K) +","+ Energy.MistFld(1,K) +","+ Energy.MistFld(2,K) +","+ Energy.MistFld(3,K) +","+ Energy.MistFld(4,K) +","+ Energy.MistFld(5,K) +","+ Energy.MistFld(6,K)
Else
Exit For
End If
Next
t.close
'End If
SaveDialog.Close
Design.Show

Will the code for “f” and “t” work?