split function

Results 1 to 7 of 7

Thread: split function

  1. #1
    Join Date
    Dec 1969
    Posts
    170

    Default split function

    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
    Join Date
    Dec 1969
    Posts
    19

    Default RE: split function

    Hi Julie, it&#039s Leonardo from Argentina.<BR><BR>I saw your question and I found an important error: You have the year whith two digits !!!<BR><BR>I would get the Date field from the text file using the CDate funcion (VBScript funcion), after doing the split, like this:<BR><BR>oDate = CDate(splitter(2))<BR><BR>This way you can compare dates and not strings.<BR><BR>The error message is because the splitter array&#039s UBound may be less than two.<BR><BR>Bye.

  3. #3
    Join Date
    Dec 1969
    Posts
    170

    Default RE: split function

    Hi ...<BR>thjanks for the help...will try it./..<BR>angie is my friend with same problem so we post the same question! fun right?:)<BR>thanks!

  4. #4
    Join Date
    Dec 1969
    Posts
    170

    Default RE: split function

    Hi ...<BR>thjanks for the help...will try it./..<BR>angie is my friend with same problem so we post the same question! fun right?:)<BR>thanks!


  5. #5
    Join Date
    Dec 1969
    Posts
    170

    Default RE: split function

    Hi ...<BR>thjanks for the help...will try it./..<BR>angie is my friend with same problem so we post the same question! fun right?:)<BR>thanks!

  6. #6
    Join Date
    Dec 1969
    Posts
    170

    Default RE: split function

    thanks...I&#039ve tried it already....still no better results....it works when users send their feedback thrpugh radio form, but it fails in the case of textarea form...!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>

  7. #7
    Join Date
    Dec 1969
    Posts
    19

    Default RE: split function

    Hello, it&#039s Leonardo again.<BR><BR>Well i would like to help you but i need the source files to see everything. You can send them to leoconforti@hotmail.com if you want. What do you mean whith a radio form and textarea form?<BR>Try to see if the submited information is ok before calling the split function.<BR><BR>I would like to know where are you from.<BR><BR>Good bye.

Posting Permissions

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