Parameter values with array (dim)

Home Forums Problems and solutions in GDL Parameter connections Parameter values with array (dim)

This topic contains 1 reply, has 2 voices, and was last updated by  Csilla Mai 2 weeks ago.

  • Author
    Posts
  • #3795

    Pavel Čapek
    Participant

    Hello,
    I struggle with creating parameter values array with DIM command.I created big main array with information about product in parameters definition . Based on specific conditions I filter parameter values from this array, but I am stuck. Values is change, but current parameter value remain unchanged. More informations are in attached picture and in code bellow.

    Here is my code for getting values from main array.

    dim aTypZdroje[]
    iOpt = 1
    
    for iOp = 1 to vardim1(aMain)
    	if	nTypOptiky = aMain[iOp][sloupecTypOptiky] & \
    		nTypMontaze = aMain[iOp][sloupecMontaz] then
    
    		bContValue = 0
    
    		for i=1 to vardim1(aTypZdroje)
    			xTypZdroje = aTypZdroje
    			yTypZdroje = aMain[iOp][sloupecTypZdroje]
    
    			if vartype(xTypZdroje) = 1 then xTypZdroje = str(xTypZdroje, 100, 0)
    
    			if xTypZdroje = yTypZdroje then bContValue = 1
    		next i
    
    		if bContValue = 0 then
    			aTypZdroje[iOpt] = aMain[iOp][sloupecTypZdroje]
    			iOpt = iOpt + 1
    		endif
    	endif
    next iOp
    values "nTypZdroje" aTypZdroje

    Thank you for your reply.

    With regards,
    Pavel

    Pavel Čapek
    BIM Project

  • #3797

    Csilla Mai
    Keymaster

    Hi Pavel,

    The values command in parameterscript only defines a set of values for the actual parameter, it does not change the parameter’s value itself.

    For changing the parameter’s value, use the parameters command:
    parameters nTypZdroje = aTypZdroje

    Csilla Mai
    Library Developer, Library Team
    GRAPHISOFT SE

You must be logged in to reply to this topic.