trying to split time...please look?

Results 1 to 5 of 5

Thread: trying to split time...please look?

  1. #1
    Raquel Anne Guest

    Default trying to split time...please look?

    I AM GETTING THIS AS AN ERROR:<BR>**************************************** *********<BR>* Microsoft VBScript runtime error &#039 800a000d&#039 *<BR>* *<BR>* Type mismatch: &#039[string: " 03:19"]&#039 *<BR>* *<BR>* /Untitled-2b.asp, line 6 *<BR>********************************************* ****<BR>AND HERE IS MY CODE:<BR><BR>&#060;% @LANGUAGE="VBSCRIPT" %&#062;<BR><BR>&#060;% itimer=Request.Form("disp1")<BR>dim var1<BR> var1 = split(itimer,":")<BR>If itimer(1) &#062; 30 Then<BR>itimer(0) = itimer(0) + 1<BR>itimer(1) = 00<BR>itimer = itimer(0) & ":" & itimer(1)<BR>Else<BR>itimer(0)=itimer(0)<BR>itimer (1) = 00<BR>itemer = itimer(0) & ":" & itimer(1)<BR>End If<BR><BR>%&#062;<BR>&#060;html&#062;<BR>&#060;hea d&#062;<BR>&#060;title&#062;Untitled Document&#060;/title&#062;<BR>&#060;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&#062;<BR>&#060;/head&#062;<BR><BR>&#060;body bgcolor="#FFFFFF"&#062;<BR>&#060;input type="text" name="textfield" value=&#039&#060;%response.write(itimer)%&#062;&#0 39&#062;<BR>&#060;/body&#062;<BR>&#060;/html&#062;<BR><BR><BR>any help would be greatly, greatly and lovingly appreciated 8o)<BR>Thanks<BR>Raquel Anne<BR>

  2. #2
    Jason Miller Guest

    Default RE: trying to split time...please look?

    Um, it looks to me like you should be using var1(x), not itimer(x) -- itimer gets split into the var1 array and is unaffected by the split function.

  3. #3
    Raquel Anne Guest

    Default YEAH BABY! IT WORKED!

    HEY!!!!!!<BR>IT WORKS!<BR>IT WORKS!<BR>THANK YOU SO VERY MUCH!

  4. #4
    Join Date
    Dec 1969
    Posts
    155

    Default RE: trying to split time...please look? - here it

    Hey there. I wish you had gotten back to me.<BR>I could have fixed your problem.<BR>This is your script and it works<BR>www.cartographytoday.com/test.asp<BR>Try it, it works.<BR>You will have to email me for the source code<BR>taylo@bannerclass.com<BR><BR>Cheers,<BR><B R>Rob Taylor<BR>taylo@bannerclass.com<BR>www.cartography today.com<BR>Be sure to stop by and vote!!!


  5. #5
    John Weeflaar Guest

    Default RE: trying to split time...please look?

    There are several ways to achieve the same result, here&#039s another one. It uses Left and Right to get the minute and second.<BR>&#060;%<BR>var1 = Request.Form("disp1")<BR>pos = Instr(var1,":") <BR>If Right(var1,Len(var1)-pos) &#062; 30 Then <BR>var1 = Left(var1,pos - 1) + 1 & ":00" <BR>Else<BR>var1 = Left(var1,pos - 1) & ":00" <BR>End If<BR>Response.write(var1)<BR>%&#062;<BR><BR>John

Posting Permissions

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