Banner Rotation

Results 1 to 2 of 2

Thread: Banner Rotation

  1. #1 Guest

    Default Banner Rotation<BR><BR>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>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?/space/control character between the file name and the .txt.<BR>I&#039ve tried using Replace(strPath," ") but it is not any of the chars I&#039ve tried (space/LF/CR)(32)(10)(16)<BR><BR>The problem that occurs has been previously posted to the discussion group , and the question can be found in a forum search, but no answer can be found, nor is there an update on the webpage.<BR>using the forum search i can find this question about the subject from 3/14/00 but no answers to it:<BR>Since I can&#039t find any replys posted to the forum I&#039m asking the question again.

  2. #2 Guest

    Default RE: Banner Rotation

    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 chr(10) with vbCrLf anywhere else in the code)<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