IF Else Condition Not Working

Results 1 to 2 of 2

Thread: IF Else Condition Not Working

  1. #1
    Steven T Guest

    Default IF Else Condition Not Working

    I am working within the Visual InterDev IDE and am hosting on Windows 2000 IIS5. I am viewing my ASP pages on IE 5.5. <BR><BR>I wrote the following block of ASP code and I get an error message. <BR><BR>Code: <BR><BR>&#060;% <BR><BR>Dim objFSO,addFile,file,extension <BR><BR>file=Request.Form("file") <BR>extension=Request.Form("extension") <BR><BR>If <BR>file="" or extension="" <BR>Then <BR>Response.Write "You must enter a file name and or Extension" <BR>Else <BR>Set objFSO=CreateObject("scripting.FileSystemObject") <BR>Set addFile=objFSO.CreateTextFile("D:TestFiles\" & Request.Form("file") & "." & Request.Form("extension"),False) <BR>Set addFile=Nothing <BR>Set objFSO=Nothing <BR>End if <BR><BR>%&#062; <BR><BR>Error Message: <BR><BR>Technical Information (for support personnel) <BR><BR>Error Type: <BR>Microsoft VBScript compilation (0x800A03EA) <BR>Syntax error <BR>/astroAdmin/testscripts/changeFile2.asp, line 9, column 2 <BR>If <BR>-^ <BR><BR><BR>Browser Type: <BR>Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) <BR><BR>Page: <BR>POST 16 bytes to /mydirectoryRoot/testscripts/changeFile2.asp <BR><BR>POST Data: <BR>file=&extension= <BR><BR>I played around with the position of the script but I thought that VBScript allowed for spaces and carriage returns. <BR><BR>Please advise. <BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default Already answered in Q&A

    Please don&#039;t crosspost. Check for your answer over in that forum.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts