cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Developer forum

GDL: Values{2} and Hotspot Display Parameters

Lingwisyer
Hero

Hi all,

 

Is there some way to get the Hotspot Display Parameter to show a Values{2} Description instead of the numeric expression?

 

 

Ling.

 

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 
7 REPLIES 7

Bruce
Expert

If you've used arrays to populate your VALUES{2} definitions, then you should be able to refer to your description array in the displayParam of the moving hotspot.

Bruce Walker
http://www.brucepwalker.com
https://www.mindmeister.com/65450406
-- since v8.1 --
AC25 5010 AUS Full | Windows 10 64 Pro | 12th Gen Intel i7-12700H 2.30 GHz | 64 Gb RAM | NVIDIA GeForce RTX 3060 32 Gb

ShaunTaylor
Booster

Hi Ling,

 

I agree with Bruce, arrays are a great way to control this kind of thing. Are you trying to display you Values list when you are dragging your hotspot, as opposed to the index? Please see attached image.

Lingwisyer_0-1683774871142.png

VALUES{2}	"marker_flip"			1,	"Top",	-1,	"Bottom"

 

Description array? This parameter is actually using a Length Type as it was inverting at -0.5 instead of 0 when it was an Integer Type...

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 

Bruce
Expert

How you have declared the VALUES{2} is fine, given there are only two values.  However, because you want to display a text value for a numerical parameter during hotspot editing, it gets a little more complicated. What you need to do is create a text parameter that gets filled with the value you want to display.  E.g. you would declare a parameter called, say "marker_flip_desc".  When marker_flip gets changed, marker_flip_desc gets changed in the parameter script to update to the value you want to display.  Creating arrays for your indexes and descriptions helps with this process.

 

I've attached an object with two different ways to achieve what you need (I've deliberately left in the precision error to keep the code as simple as possible).  Hope it helps.

Bruce Walker
http://www.brucepwalker.com
https://www.mindmeister.com/65450406
-- since v8.1 --
AC25 5010 AUS Full | Windows 10 64 Pro | 12th Gen Intel i7-12700H 2.30 GHz | 64 Gb RAM | NVIDIA GeForce RTX 3060 32 Gb

Lingwisyer
Hero
What you need to do is create a text parameter that gets filled with the value you want to display. 

Yeah, that was what I was wanting to avoid as I already have a lot of dynamic arrays which have alot of different ways to be updated... was hoping there was some other way. Barry brought that up in a different post when I was having issues with how AC rounds value inputs. I had thought I might have been able to use an inline variable, but you cannot seem to use those as a display parameter...

 

DIM toggle[]
IF sg_gridToggle[i][1] = 1 then
		toggle[i] = "Show"
	else
		toggle[i] = "Hide"
endIF

 

 

 

Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 

Hi Ling,

 

Not quite sure what you are trying to achieve here. But if you are trying to get the Values list options to show and display as you are dragging, then you can always make 2 values statements. One for a string and one for an integer. You can use an IF statement to link these parameters so that they are always being updated when each one is changed. You can allocate the "Integer" values list to the value in your hotspot and the "String" values list to the display parameter in your hotspot.

 

I have attached an example. But not sure if this is what you are trying to do.

 

Cheers,

Shaun.

Well yeah. Since the hotspot command wants to have a parameter for displaying, you can't use parvalue_description or other shenanigans.... You will sadly need to resort to doubling the parameter and have one just for displaying the string...

Mostly AC 26 on Mac | Author of SelfGDL | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!