This driving me Nut

Results 1 to 3 of 3

Thread: This driving me Nut

  1. #1
    This driving me Nut Guest

    Default This driving me Nut

    Sorry it&#039s me again.<BR>All I tried to do was to create a random text file. I just want to make sure that I am not over write any file already exit that&#039s all and this code seem not working, and I don&#039t know why.<BR><BR>&#060;%<BR> dim i <BR> i = 0<BR> dim fname<BR> fname = "testfile" & i & ".txt"<BR> Set objfs = Server.CreateObject("Scripting.FileSystemObject")< BR> testfname = "/Inetpub/wwwroot/AC/Data/" & fname<BR> Response.Write testfname<BR> While objfs.FileExists(testfname)<BR> Response.Write fname & " Aldready exist "<BR> i = i + 1<BR> fname = "testfile" & i & ".txt"<BR> Wend<BR> Set f = objfs.CreateTextFile("/Inetpub/wwwroot/AC/Data/" & fname , True)<BR> f.WriteLine "It&#039s Working"<BR>%&#062;<BR><BR>This code give me an error of <BR>Active Server Pages, ASP 0113 (0x80004005)<BR> The maximum amount of time for a script to execute was<BR> exceeded. You can change this limit by specifying a new value<BR> for the property Server.ScriptTimeout or by changing the value<BR> in the IIS administration tools.<BR> /ac/test.asp<BR><BR>Can some one tell me why.<BR>Thank you a lot.<BR>TD

  2. #2 Guest

    Default Endless loop

    Inside your while loop, I think you meant to try different names until your found one that didn&#039t exist, but you keep setting the variable "fname" but your loop is testing the value of variable "testfname". Therefore you will never get out of the loop, because "testfname" does not change.

  3. #3
    Thank You So Much Guest

    Default RE: Endless loop

    Thank you so much you don&#039t know how much it mean to me. I have been looking at it all night long. And what buggiing me was I know this is a simple problem. May be I look too hard at it hihihi. Thank again.<BR>TD

Posting Permissions

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