help with script

Results 1 to 2 of 2

Thread: help with script

  1. #1
    Join Date
    Dec 1969
    Posts
    144

    Default help with script

    I get this as an error:<BR><BR>Microsoft VBScript compilation error &#039 800a0414&#039 <BR><BR>Cannot use parens when calling a Sub <BR><BR>/Untitled-2b.asp, line 8 <BR><BR>split(ok, ":")<BR>--------------^<BR><BR>here is my code:<BR><BR>&#060;% @LANGUAGE="VBSCRIPT" %&#062;<BR>&#060;%<BR>disp=Request.Forum("disp1")< BR>ok=Request.Form("disp1")<BR>%&#062;<BR><BR>&#06 0;%<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> <BR>&#060;/p&#062;<BR>&#060;p&#062; <BR> &#060;input type="text" name="textfield" value=&#039&#060;%response.write(disp)%&#062;&#039 &#062;<BR>&#060;/p&#062;<BR>&#060;p&#062; &#060;%response.write(ok)%&#062; &#060;/p&#062;<BR>&#060;p&#062;&nbsp; &#060;/p&#062;<BR>&#060;/body&#062;<BR>&#060;/html&#062;<BR><BR>here is what I am trying to do:<BR><BR>ok is passed from the previus page textbox called disp1<BR>I want to make the time....in example: 10:31, 10=minutes, 31=seconds<BR>to read as 11 minutes dropping the :00<BR><BR>if the time was 10:29, 10=minutes, 29=seconds, then read as<BR>10 minutes.<BR><BR>can you help? Please?<BR>Thanks in advance!<BR>Ray

  2. #2
    Join Date
    Dec 1969
    Posts
    41

    Default RE: help with script

    Split returns a value so you have to do var = split(ok, ":") then use var(x)

Posting Permissions

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