Calling a Function with more than one parm.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rockocubs

    Calling a Function with more than one parm.

    I want to pass the function to string parms how do i seperate them.

    <form>
    <input type="button"
    onClick="openTe mplate('K:\pcr\ 764\Requirement s\','Requiremen t
    Specification Document-DWD v1.52.doc')" value="Requirem ents Template">
    </form>

    When i only passed one string like thjis it worked.

    <form>
    <input type="button"
    onClick="openTe mplate('K:\pcr\ 764\Requirement s\Requirement Specification
    Document-DWD v1.52.doc')" value="Requirem ents Template">
    </form>

  • Randy Webb

    #2
    Re: Calling a Function with more than one parm.

    rockocubs wrote:
    [color=blue]
    > I want to pass the function to string parms how do i seperate them.[/color]

    With commas like you did.
    [color=blue]
    > <form>
    > <input type="button"
    > onClick="openTe mplate('K:\pcr\ 764\Requirement s\','Requiremen t
    > Specification Document-DWD v1.52.doc')" value="Requirem ents Template">
    > </form>
    >
    > When i only passed one string like thjis it worked.
    >
    > <form>
    > <input type="button"
    > onClick="openTe mplate('K:\pcr\ 764\Requirement s\Requirement Specification
    > Document-DWD v1.52.doc')" value="Requirem ents Template">
    > </form>[/color]

    Then openTemplate is only set up to use/utilize one parameter.

    --
    Randy
    comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly

    Comment

    • rockocubs

      #3
      Re: Calling a Function with more than one parm.

      Here is the Function.
      function openTemplate(do cumentPath,docu mentName)
      {
      var str1 = documentPath + documentName;
      var str2 = [ "K:","Deloitte" ,"Team1 Status report", prompt("Enter Pcr
      Number",""), documentName
      ].join("\\");



      OpenDoc1(str1,s tr2);


      }


      Comment

      • RobB

        #4
        Re: Calling a Function with more than one parm.

        rockocubs wrote:[color=blue]
        > Here is the Function.
        > function openTemplate(do cumentPath,docu mentName)
        > {
        > var str1 = documentPath + documentName;
        > var str2 = [ "K:","Deloitte" ,"Team1 Status report", prompt("Enter Pcr
        > Number",""), documentName
        > ].join("\\");
        >
        >
        >
        > OpenDoc1(str1,s tr2);
        >
        >
        > }[/color]

        You need to escape that backslash at the end of the first argument, or
        it'll mask the following (delimiter) quote and foul things up.
        Something else odd going on with that function but I adjusted it & it
        went away. OK by me.

        function openTemplate(do cumentPath, documentName)
        {
        var str1 = documentPath + documentName;
        var str2 = [
        "K:" ,
        "Deloitte" ,
        "Team1 Status report" ,
        prompt("Enter Pcr Number", "") ,
        documentName
        ].join("\\");

        OpenDoc1(str1,s tr2);
        }

        <input
        type="button"
        onclick="openTe mplate('K:\pcr\ ­764\Requiremen ts\\',
        'Requiremen­t specification Document-DWD v1.52.doc')"
        value="Requirem ents Template">

        Comment

        • rockocubs

          #5
          Re: Calling a Function with more than one parm.

          Is the 3D stuff suspose to be there?

          Comment

          • Random

            #6
            Re: Calling a Function with more than one parm.

            rockocubs wrote:[color=blue]
            > Is the 3D stuff suspose to be there?[/color]

            Ignore 3D -- it's base64 encoding used during the transfer of articles.
            You shouldn't be seeing it.

            Comment

            • Randy Webb

              #7
              Re: Calling a Function with more than one parm.

              rockocubs wrote:
              [color=blue]
              > Here is the Function.[/color]

              OK, read this groups FAQ with regards to quoting what you are replying to.
              [color=blue]
              > function openTemplate(do cumentPath,docu mentName)
              > {
              > var str1 = documentPath + documentName;
              > var str2 = [ "K:","Deloitte" ,"Team1 Status report", prompt("Enter Pcr
              > Number",""), documentName
              > ].join("\\");
              >
              >[/color]

              Here, add an alert('str1 = ' + str1 + '\nstr2 = ' + str2)

              And check to see if str1 and st2 are what you think they should be.
              [color=blue]
              > OpenDoc1(str1,s tr2);
              > }[/color]

              You call a function to create variables to call another function? And in
              the middle of it all, a prompt?

              Where is OpenDoc1? If openTemplate is recieving, and passing, the proper
              parameters, check in OpenDoc1.

              --
              Randy
              comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly

              Comment

              Working...