Help with variables

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with variables

    How do I assign two variables to another variable.
    example:
    assign/V1 = array(blah, blah, blah)
    assign/V2 = array(blah, blah, blah)
    assign/V3 = max(V1)
    assign/V4 = max(V2)
    assign/V5 = max(V3 V4)

    The last line doesn't work.

    Thanks

  • #2
    assign/V5 = max(V3 V4)
    Depending on what you what you must put an operator in there. There are a lot of math functions you can do. We need more info. Do you want the max either v3 or v4?
    Dale
    v2011 MR1 CAD ++

    Comment


    • #3
      I don't know, I've never tried it.

      Have you tried assigning v3 and v4 to another array (can you do that???) and then do the max of that? Or, I guess you could assign everthing from both arrays to a single seperate array?

      Comment


      • #4
        Originally posted by Jeff Andresen View Post
        How do I assign two variables to another variable.
        example:
        assign/V1 = array(blah, blah, blah)
        assign/V2 = array(blah, blah, blah)
        assign/V3 = max(V1)
        assign/V4 = max(V2)
        assign/V5 = max(V3 V4)

        The last line doesn't work.

        Thanks

        Try This
        ASSIGN/V1 = PNT1.X
        ASSIGN/V2 = PNT2.X
        ASSIGN/V3 = PNT3.X
        ASSIGN/V4 = PNT4.X
        ASSIGN/V5 = PNT5.X
        ASSIGN/V6 = ARRAY(V1,V2,V3,V4,V5)
        ASSIGN/V7 = ARRAY(V1,V2,V3,V4,V5)
        ASSIGN/V8 = MAX(V6)
        ASSIGN/V9 = MAX(V7)
        ASSIGN/V10 = ARRAY(V8,V9)
        ASSIGN/V11 = MAX(V10)
        sigpic.....Its called golf because all the other 4 letter words were taken

        Comment


        • #5
          ASSIGN/V1 = PNT1.X
          ASSIGN/V2 = PNT2.X
          ASSIGN/V3 = PNT3.X
          ASSIGN/V4 = PNT4.X
          ASSIGN/V5 = PNT5.X
          ASSIGN/V6 = ARRAY(V1,V2,V3,V4,V5)
          ASSIGN/V7 = ARRAY(V1,V2,V3,V4,V5)

          ASSIGN/V8 = MAX(V6)
          ASSIGN/V9 = MAX(V7)
          ASSIGN/V10 = ARRAY(V8,V9)
          ASSIGN/V11 = MAX(V10)
          Bob, is there a way to shorten this up. Say I had 50 points from a scan. Could it read:
          ASSIGN/V6 = ARRAY(V1:V50)
          ASSIGN/V8 = MAX(V6)

          Just wondering
          Thanks
          Dale
          v2011 MR1 CAD ++

          Comment


          • #6
            Originally posted by WScmm View Post
            Bob, is there a way to shorten this up. Say I had 50 points from a scan. Could it read:
            ASSIGN/V6 = ARRAY(V1:V50)
            ASSIGN/V8 = MAX(V6)

            Just wondering
            Thanks
            Not that i'm aware of, but their are other folks here who probably know more about it then me. I dabble in variables
            sigpic.....Its called golf because all the other 4 letter words were taken

            Comment


            • #7
              Thanks. I guess I should have read the original post better and I may have come up w/ a better answer. After I seen what you posted I thought boy what was I thinking. I guess it is going to be one of those days, but it is FRIDAY!
              Dale
              v2011 MR1 CAD ++

              Comment


              • #8
                I don't know if this will work but you could give it a shot. You should test it out a few ways to make sure you are getting what you want

                Code:
                assign/V1 = array(blah, blah, blah)
                assign/V2 = array(blah, blah, blah)
                assign/V3 = array(V1, V2)
                assign/V4 = max(V3)
                It might end up being a 2 dimensional array and I am not sure how that evaluates.
                <internet bumper sticker goes here>

                Comment


                • #9
                  Originally posted by craiger_ny View Post
                  I don't know if this will work but you could give it a shot. You should test it out a few ways to make sure you are getting what you want

                  Code:
                  assign/V1 = array(blah, blah, blah)
                  assign/V2 = array(blah, blah, blah)
                  assign/V3 = array(V1, V2)
                  assign/V4 = max(V3)
                  It might end up being a 2 dimensional array and I am not sure how that evaluates.
                  That is what I was intending to suggest.

                  Also, couldn't you just do this?

                  Code:
                  assign/V1 = array(blah1, blah2, blah3)
                  assign/V2 = array(blah4, blah5, blah6)
                  assign/V3 = array(blah1, blah2, blah3, blah4, blah5, blah6)
                  assign/V4 = max(V3)

                  Comment


                  • #10
                    Originally posted by Goodluck View Post
                    That is what I was intending to suggest.

                    Also, couldn't you just do this?

                    Code:
                    assign/V1 = array(blah1, blah2, blah3)
                    assign/V2 = array(blah4, blah5, blah6)
                    assign/V3 = array(blah1, blah2, blah3, blah4, blah5, blah6)
                    assign/V4 = max(V3)
                    I've had times when i've had so many points i had to assign 2 arrays. Each line only takes so many.
                    sigpic.....Its called golf because all the other 4 letter words were taken

                    Comment


                    • #11
                      Originally posted by bw_bob View Post
                      I've had times when i've had so many points i had to assign 2 arrays. Each line only takes so many.
                      Ah, I see now.

                      Comment


                      • #12
                        Jeff, how is it going? I do this all the time w/o incedent.
                        sigpic 1.61803399Δ
                        ASSIMILATE INTERGRATE SYNTHESIZE

                        Comment


                        • #13
                          Actually, I used the code suggested here and it worked fine...

                          assign/V1 = array(blah, blah, blah)
                          assign/V2 = array(blah, blah, blah)
                          assign/V3 = array(V1, V2)
                          assign/V4 = max(V3)

                          Comment

                          Related Topics

                          Collapse

                          Working...
                          X