ASSOCLP_​​PARVALUE_​​WITH_​​DESCRIPTION

Home Forums Problems and solutions in GDL Informations from the environment ASSOCLP_​PARVALUE_​WITH_​DESCRIPTION

This topic contains 8 replies, has 2 voices, and was last updated by  James Murray 1 week, 3 days ago.

  • Author
    Posts
  • #3934

    James Murray
    Participant

    I assume this is the version of ASSOCLP_PARVALUE to use with parameters that have a VALUES{2} list. If so, I don’t understand how to get the description part of a given value.

  • #3935

    Gergely Fehér
    Keymaster

    I tried wtih the following code in a labels’ 2d script:

    dim p_values_and_descriptions[][]
    n = REQUEST ("ASSOCLP_PARVALUE_WITH_DESCRIPTION", "myParam", name_or_index, type, flags, dim1, dim2, p_values_and_descriptions)
    
    for ii = 1 to vardim1(p_values_and_descriptions)
    	for jj = 1 to vardim2(p_values_and_descriptions)
    		text2 jj, ii, p_values_and_descriptions[ii][jj]
    	next jj
    next ii

    This code writes both the integer value and the description to the floorplan view.

    Gergely Fehér
    Team Leader, Library Team
    GRAPHISOFT SE

  • #3936

    James Murray
    Participant

    Thanks, Gergely, but I’m not getting it. I did notice the TEXT2 line needs to be text2 j, i, p_values_and_descriptions[i][j]. But the label is still empty when applied. I’ve attached a simple test case.

  • #3938

    James Murray
    Participant

    Again what I post does not show up. I was trying to say the text2 line needs to refer to p_values_and_descriptions[i][j], not just [j]. (Incidentally, I tried to bold the [i].)

  • #3939

    James Murray
    Participant

    One more try. open square bracket i close square bracket open square bracket j close square bracket. Maybe it did the same thing to your text. Thanks again for the help.

  • #3940

    Gergely Fehér
    Keymaster

    Sorry, I changed to ii and jj, I hope it helps. (The forum engine stoles the single i char in square brackets, as it thinks is is an italic definition for text formatting.)

    Gergely Fehér
    Team Leader, Library Team
    GRAPHISOFT SE

  • #3941

    James Murray
    Participant

    Thanks, I’m getting closer. The array dump works. How do I capture just the description? I get an error if I try to set a variable equal to p_values_and_descriptions[1][1], for example.

  • #3966

    James Murray
    Participant

    Anything more on this?

  • #3996

    James Murray
    Participant

    Gergely, I’ve submitted this as #244744. I would have PM’d you but I didn’t see the option.

You must be logged in to reply to this topic.