I need help badly.....please help?

Results 1 to 10 of 10

Thread: I need help badly.....please help?

  1. #1
    HELP!!!!!! Guest

    Default I need help badly.....please help?

    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. #2
    Join Date
    Dec 1969
    Posts
    155

    Default RE: I need help badly.....please help?

    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. #3
    Join Date
    Dec 1969
    Posts
    144

    Default RE: I need help badly.....please help?

    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. #4
    HELP!!!!! Guest

    Default RE: I need help badly.....please help?

    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. #5
    HELP!!!!! Guest

    Default RE: I need help badly.....please help?

    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. #6
    HELP!!!!! Guest

    Default RE: I need help badly.....please help?

    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. #7
    HELP!!!!! Guest

    Default RE: I need help badly.....please help?

    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. #8
    help?? Guest

    Default RE: I need help badly.....please help?

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

  9. #9
    Nathen Grass Guest

    Default RE: I need help badly.....please help?

    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. #10
    Marlin Guest

    Default RE: I need help badly.....please help?

    try this,<BR>use a holding variable (say varMinutes_Hold)<BR>&#060;% if seconds&#062;30 then varMinutes_Hold=1<BR>Else varMinutes_Hold=0<BR>End If<BR>Time_Minutes=Time_minutes+varMinutes_Hold<BR >%&#062;<BR>

Posting Permissions

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