Reply To: Newparameter

#2477
Dominika Bobály
Keymaster

There are multiple problems with the script above:
– the 2 arrays in the master should run to the 4th index (you have double 3)
– values{2} only works for integer types (“A” is length type by default)
– loose the array brackets in the values{2} command definition
– the ASSOCLP_PARVALUE_WITH_DESCRIPTION request returns pairs of value-description of the requested parameter, so info1 should be an array type of variable (otherwise it will only contain the first returned value only, without description string)
You can do this:

dim info1[]

n = REQUEST("ASSOCLP_PARVALUE_WITH_DESCRIPTION", "parammparamm", DUMMY_name_index, DUMMY_type, DUMMY_flags, d, dd, info1)

if vardim1(info1) > 0 then
	for ii = 1 to vardim1(info1) step 2
		text2 0, 0, info1[ii]
		text2 1, 0, info1[ii+1]
	next ii
endif

Dominika Bobály
Library Developer, Library Team
GRAPHISOFT SE