help pls

Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: help pls

  1. #1
    angi Guest

    Default help pls

    Hi....here&#039s the problem:<BR><BR>Users are sending feedback via browser through a textarea form. I copy the feedback data to a text file. Now I want to view the file in my browser, selected by a particular date. <BR>Here is an e.g of my textfile (CSV file):<BR><BR>************************************ **********************<BR>System Name; User Name ;Date & Time ; Error Report<BR>NWWKS3;Rudy Lim;19/8/99 4:11:12PM;the file not found <BR>********************************************** ****************<BR><BR>The script to select by date was:<BR><BR>Do While NOT MyStream.AtEndOfStream<BR><BR><BR>strline = MyStream.ReadLine<BR>splitter = split(strline,";")<BR><BR><BR>UserSwInstallDate_ti me = split(splitter(2),"")<BR>UserSwInstallDate = UserSwInstallDate_time(0)<BR><BR>Here I get the date and compare ot with the date I selected to view....<BR>I get the corect data on my browser but with the following error:<BR><BR>Microsoft VBScript runtime error &#039 800a0009&#039 <BR>Subscript out of range: &#039[number: 2]&#039 <BR><BR>What&#039s wrong here????<BR>But When user send me data from a radio form I get no such error...why do i get it with a textarea form? <BR><BR>can anyone help pls?<BR>Thanks a lot!<BR>

  2. #2
    John Weeflaar Guest

    Default RE: help pls

    Try to check if there is a blank line in your text file.<BR>If yes, then, it can probably cause an error.<BR>The error, in my opinion starts from this line:<BR>splitter = split(strline,";")<BR>If there is a blank line, you&#039ll have an array with only one element: splitter(0), and so, referring to splitter(2) generates<BR>an error. Also, if there is a line with no commas, then, it&#039ll<BR>generate an error when referring to splitter(2).<BR>Use also Response.write to see the result.<BR><BR>Hope that helps.<BR><BR>John<BR>

  3. #3
    angi Guest

    Default RE: help pls

    hi...<BR>thnaks for your help...<BR>but i&#039ve really ensured that there&#039s no blank line in my text file....it&#039s 100% similar to the data I get when users use a radio form....but when they send through a textarea form...<BR>i will get the error i mentioned before....the data will be displcaed but the error will also be there....I really don&#039t understand coz it does work for the radio form and in both cases, the textfiles are identical....what could be wrong with textarea form i don&#039t know.....<BR>

  4. #4
    John Weeflaar Guest

    Default RE: help pls

    I don&#039t know if this makes any difference, but you can try:<BR><BR>Do While NOT MyStream.AtEndOfStream<BR>strline = MyStream.ReadLine<BR>strline = Replace(strline, Chr(10),"") &#039 empty string<BR>strline = Replace(strline, Chr(13)," ") &#039 a space<BR>strline = Trim(strline)<BR>splitter = split(strline,";")<BR>UserSwInstallDate = Trim(splitter(2))<BR>...<BR>Would you explain how you copy the text from the text area into the text file, and what does the user type in the text area? <BR><BR> John


  5. #5
    angi Guest

    Default RE: help pls

    Here is how I wrote to the csvfile :<BR><BR>LogError is the name of the textarea form<BR>****************************************** ********************8<BR> otherErrMsg = request.Form("LogError")<BR><BR><BR><BR>IF (otherErrMsg &#060;&#062; "") THEN<BR> MyOutStream1.WriteLine(MachineName & ";" & FullName & ";" & date_ & ";" & otherErrMsg) <BR> <BR>end if<BR><BR>*************<BR><BR><BR>And user can enter any error msg e.g " the file was not found"<BR><BR>thanks...<BR><BR><BR>actuallyu in the sript, I&#039ve included radio and textarea forms together...I mean...only one form for radio and textara ...is that a problem? I gad to do it that way since the first part is to give user a choice of errors and the next is for user to enter his own error....<BR>

  6. #6
    John Weeflaar Guest

    Default RE: help pls

    Okay. Now I see one possible problem. It&#039s the dreadful<BR>apostrophe problem.<BR> You can try this and see how it goes:<BR>If (otherErrMsg &#060;&#062; "") Then<BR> otherErrMsg = Replace(otherErrMsg, Chr(10),"")<BR> otherErrMsg = Replace(otherErrMsg, Chr(13)," ")<BR> str = "&#039" & MachineName & "&#039" & ";" & "&#039" & FullName & "&#039"<BR> str = str & ";" & "&#039" & date_ & "&#039" & ";" <BR> str = str & "&#039" & otherErrMsg & "&#039"<BR>MyOutStream1.Writeline(str)<BR>End If<BR><BR>Hope that gets better and let us know the result.<BR><BR>John

  7. #7
    John Weeflaar Guest

    Default RE: help pls

    Angie,<BR><BR>My other solution wasn&#039t quite right (not neccesarry to<BR>construct: "&#039" & variable & "&#039"). Actually what you need is only<BR>to remove the carriage returns (otherwise the "otherErrMsg" string will be broken into 2 or more lines in the text file).<BR>Try to add these 2 lines. <BR><BR>If (otherErrMsg &#060;&#062; "") Then<BR>otherErrMsg = Replace(otherErrMsg, Chr(10),"")<BR>otherErrMsg = Replace(otherErrMsg, Chr(13)," ")<BR>MyOutStream1.WriteLine(MachineName & ";" & FullName & ";" & date_ & ";" & otherErrMsg) <BR><BR>End if<BR><BR>John

  8. #8
    angi Guest

    Default RE: help pls

    hi...<BR><BR>I got this message only today!:) well I did what u told me last time...must admit it was rather confusing with all the "&#039" everywhere:) but it seems that I&#039ve got the results i wanted...the feedback can now bw displayed...except that now I have apostrophe in my logfiles...<BR>well i will try to do what u just told me...<BR>thanks anyway...<BR><BR>does anyone happen to know some sites where I can get samples of proper error reports on the web? mine will seem messy if the user sends a long report!:)

  9. #9
    angi Guest

    Default RE: help pls

    Just tried it<BR>It works thanks!:)

  10. #10
    angi Guest

    Default RE: help pls

    Just now it was working now it works no more...I don&#039t understand....but never mind...for the time being I&#039m leaving all the apstrophes in the logfiles....<BR>thanks...

Posting Permissions

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