Great Article, but asp doesn't work... help!!!

Results 1 to 2 of 2

Thread: Great Article, but asp doesn't work... help!!!

  1. #1
    Join Date
    Dec 1969

    Default Great Article, but asp doesn't work... help!!!

    The article on the website called <BR>"Creating a Banner Rotation System" includes a great set of asps that should work on any machine, but I cannot get them to work on mine. The problem is in the "banner.asp". I have tried everything and I am stuck. <BR><BR>The problem lies around here:<BR>105: strPath = path & "clicks\" & banInfo(count,bannerID) & ".txt"<BR>106:<BR>107: Dim impressions<BR>108:<BR>109: if fs.FileExists(strPath) then<BR>110: Set banFile = fs.OpenTextFile(strPath,1)<BR>111: impressions = CInt(banFile.ReadLine)<BR>112: else<BR>113: Set banFile = fs.CreateTextFile(strPath,True)<BR>114: impressions = 0<BR>115: end if<BR><BR>When it tries to creat that text file in line 113, it gags. If I include an extra line of code:<BR>response.write(strPath) <BR>I can see that there is a carriage return between the file name and the .txt<BR><BR>That means I have to examine what the temparrays are doing in lines 50 through 66. THey examine a different file called "banners.txt"<BR>and create snippets. The problem is that ALL the snippets of text have a carriage return after them, and they should not. Also, they do not line up.<BR><BR>THis is a cut and paste code available on this website at:<BR><BR><BR>If you can help me figure out what the problem is, or tell me who the author is, I would appreciate it. <BR><BR>THanks,<BR><BR>Edward<BR><BR>

  2. #2 Guest

    Default RE: Great Article, but asp doesn't work... hel

    This comes from a reply I received from Scott Mitchell and it works!:<BR>This is likely caused because you are using vbCrLf and not chr(10) as the<BR>delimiters in your banner.txt file. In banner.asp<BR>(, where it reads:<BR><BR> if right(records(i),1) = chr(10) then<BR> records(i) = left(records(i), len(records(i)) - 1)<BR> end if<BR> if left(records(i),1) = chr(10) then<BR> records(i) = right(records(i), len(records(i)) - 1)<BR> end if<BR><BR>replace the chr(10) with vbCrLf (and replace the chr(10) with vbCrLf throughout this page)<BR><BR>That should do the trick...<BR><BR> Scott Mitchell

Posting Permissions

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