1. HELP!!!!!! Guest

ok...here is what I got:<BR>code that is a timer and then passes the timer time through itime=Request.form(time).<BR>now I need to take the itime and convert it to minutes only, for example:<BR><BR>time = 10:31<BR>10=minutes<BR>31=seconds<BR><BR>I need calctime to equal this: 11 minutes<BR><BR>If the seconds are = &#062; 30 round up to minute<BR>If the seconds are &#060; 30 then drop seconds and keep minute<BR><BR>so if time = 10:29<BR>10 = minutes<BR>29 = seconds<BR><BR>I need calctime to equal this: 10 minutes<BR><BR>this may seem simple, but am having a hell of a time figuring it out....any help would be greatly appreciated!<BR>Thanks in advance,<BR>Ray

2. Senior Member
Join Date
Dec 1969
Posts
155

Split it<BR><BR>split(time,":")<BR>If time(1) &#062; 30 Then<BR>time(0) = time(0) + 1<BR>time(1) = 00<BR>time = time(0) & ":" & time(1)<BR>Else<BR>time(0)=time(0)<BR>time(1) = 00<BR>time = time(0) & ":" & time(1)<BR>End If<BR><BR>All this does is split time on the ":".<BR>time is then 2 sections<BR>time(0) is the hours portion and time(1) is the minutes portion.<BR>Take it apart, manipulate it, then put it back together.<BR>Split is one of the coolest things in scripting languages.<BR><BR>Let me know if you need anymore help<BR><BR>Rob Taylor<BR>taylo@bannerclass.com<BR>www.cartography today.com<BR><BR>

3. Ray
Senior Member
Join Date
Dec 1969
Posts
144

I get this as an error:<BR>Microsoft VBScript compilation error &#039 800a0414&#039 <BR><BR>Cannot use parens when calling a Sub <BR><BR>/Untitled-2b.asp, line 5 <BR><BR>split(ok,":")<BR>-------------^<BR><BR>here is the code I used:<BR><BR>&#060;% @LANGUAGE="VBSCRIPT" %&#062;<BR>&#060;%<BR>ok=Request.Form("disp1")<BR> <BR>split(ok,":")<BR>If ok(1) &#062; 30 Then<BR>ok(0) = ok(0) + 1<BR>ok(1) = 00<BR>ok = ok(0) & ":" & ok(1)<BR>Else<BR>ok(0)=ok(0)<BR>ok(1) = 00<BR>ok = ok(0) & ":" & ok(1)<BR>End If<BR><BR>%&#062;<BR><BR>&#060;html&#062;<BR>&#060 ;head&#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;p&#062;<BR> &#060;%response.write(ok)%&#062;<BR>&#060;/p&#062;<BR>&#060;p&#062;&nbsp; &#060;/p&#062;<BR>&#060;/body&#062;<BR>&#060;/html&#062;<BR>

4. HELP!!!!! Guest

I get this as an error:<BR>Microsoft VBScript compilation error &#039 800a0414&#039 <BR><BR>Cannot use parens when calling a Sub <BR><BR>/Untitled-2b.asp, line 5 <BR><BR>split(ok,":")<BR>-------------^<BR><BR>and here is the code:<BR><BR>&#060;% @LANGUAGE="VBSCRIPT" %&#062;<BR>&#060;%<BR>ok=Request.Form("disp1")<BR> <BR>split(ok,":")<BR>If ok(1) &#062; 30 Then<BR>ok(0) = ok(0) + 1<BR>ok(1) = 00<BR>ok = ok(0) & ":" & ok(1)<BR>Else<BR>ok(0)=ok(0)<BR>ok(1) = 00<BR>ok = ok(0) & ":" & ok(1)<BR>End If<BR><BR>%&#062;<BR><BR>&#060;html&#062;<BR>&#060 ;head&#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;p&#062;<BR> &#060;%response.write(ok)%&#062;<BR>&#060;/p&#062;<BR>&#060;p&#062;&nbsp; &#060;/p&#062;<BR>&#060;/body&#062;<BR>&#060;/html&#062;

5. HELP!!!!! Guest

I get this as an error:<BR>Microsoft VBScript compilation error &#039 800a0414&#039 <BR><BR>Cannot use parens when calling a Sub <BR><BR>/Untitled-2b.asp, line 5 <BR><BR>split(ok,":")<BR>-------------^<BR><BR>and here is the code:<BR><BR>&#060;% @LANGUAGE="VBSCRIPT" %&#062;<BR>&#060;%<BR>ok=Request.Form("disp1")<BR> <BR>split(ok,":")<BR>If ok(1) &#062; 30 Then<BR>ok(0) = ok(0) + 1<BR>ok(1) = 00<BR>ok = ok(0) & ":" & ok(1)<BR>Else<BR>ok(0)=ok(0)<BR>ok(1) = 00<BR>ok = ok(0) & ":" & ok(1)<BR>End If<BR><BR>%&#062;<BR><BR>&#060;html&#062;<BR>&#060 ;head&#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;p&#062;<BR> &#060;%response.write(ok)%&#062;<BR>&#060;/p&#062;<BR>&#060;p&#062;&nbsp; &#060;/p&#062;<BR>&#060;/body&#062;<BR>&#060;/html&#062;

6. HELP!!!!! Guest

I get this as an error:<BR>Microsoft VBScript compilation error &#039 800a0414&#039 <BR><BR>Cannot use parens when calling a Sub <BR><BR>/Untitled-2b.asp, line 5 <BR><BR>split(ok,":")<BR>-------------^<BR><BR>and here is the code:<BR><BR>&#060;% @LANGUAGE="VBSCRIPT" %&#062;<BR>&#060;%<BR>ok=Request.Form("disp1")<BR> <BR>split(ok,":")<BR>If ok(1) &#062; 30 Then<BR>ok(0) = ok(0) + 1<BR>ok(1) = 00<BR>ok = ok(0) & ":" & ok(1)<BR>Else<BR>ok(0)=ok(0)<BR>ok(1) = 00<BR>ok = ok(0) & ":" & ok(1)<BR>End If<BR><BR>%&#062;<BR><BR>&#060;html&#062;<BR>&#060 ;head&#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;p&#062;<BR> &#060;%response.write(ok)%&#062;<BR>&#060;/p&#062;<BR>&#060;p&#062;&nbsp; &#060;/p&#062;<BR>&#060;/body&#062;<BR>&#060;/html&#062;

7. HELP!!!!! Guest

I get this as an error:<BR>Microsoft VBScript compilation error &#039 800a0414&#039 <BR><BR>Cannot use parens when calling a Sub <BR><BR>/Untitled-2b.asp, line 5 <BR><BR>split(ok,":")<BR>-------------^<BR><BR>

8. help?? Guest

I sent you my problem to your e-mail<BR>thanks,<BR>Ray

9. Nathen Grass Guest

The error comes from the fact that you&#039re calling a function without setting it equal to anything. If you were call a Sub the you wouldn&#039t need to set it equal to anything. Also Subs do not use parentheses and functions do when you&#039re calling them.<BR><BR>Calling Sub<BR>subname param1,param2<BR><BR>Calling Function<BR>var1 = functionName(param1,param2)<BR><BR>

10. Marlin Guest