Specifying a global field dynamically

I am trying to specify a global field similar to specifying an object on a form:
forms.Buttons_Panel.elements[buttonpanel].text

I wanted to do something like

var buttonvar = ‘Button’ + arguments[0];
globals[buttonvar] = arguments[0];

However, this doesn’t work. I don’t get an error, it just returns zero. If I do

globals.Button1 = arguments[0];

it returns the correct result to the global field. I assumed you could do the same with globals as you could do with forms. Is this not true? Or do I have the wrong syntax? Thanks.

Reed

Hi Reed,

In Servoy Editor when you select the Elements node of a form you see that it has properties (allnames, length, [index], [‘name’])
When you select the node of globals it shows no properties at all.
So I guess it’s safe to say that what you want can’t be done.

If you really want it then you should post a feature request for it on this forum.

Hope this helps.

Thanks for the reply. It is not a big deal now but if it something I end up really needing I will post a feature request.

Reed