Control Name in a string and setting properties

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

Pnirff
Ebase User
Posts: 21
Joined: Fri Jan 25, 2013 8:36 am

Control Name in a string and setting properties

#1

Postby Pnirff » Thu Mar 14, 2013 10:00 am

Hey again,

your software is wonderful and I realy like it. Hope, I find a solution for this:

I got a FPL script look like the following code:

char sControlName;
set sControlName = 'MY_PRIVATE_CTRL';

now I want to hide this control or set other properties like

set sControlName.hide = 'true';

In some programing languages you can add a "$" so that the var name is not uses as the control name.

Thank you for your help again
Manfred
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Thu Mar 14, 2013 11:00 am

Manfred,

With FPL, you need to use the interpret command e.g.

Code: Select all

char sControlName;
set sControlName = 'MY_PRIVATE_CTRL'; 
interpret 'hide ' + sControlName;


With Javascript, you could do this:

Code: Select all

var  sControlName = 'MY_PRIVATE_CTRL'; 
controls.getControl(sControlName).hide();
or you could use the eval() function which is the equivalent of the FPL interpret.

Jon
0 x

Pnirff
Ebase User
Posts: 21
Joined: Fri Jan 25, 2013 8:36 am

#3

Postby Pnirff » Thu Mar 14, 2013 12:58 pm

Hello,

cool. Realy cool.
This works fine and is exactly what I was looking for.

Best regards
Manfred

8)
0 x


Who is online

Users browsing this forum: Bing [Bot] and 37 guests