Dynamic graphs/tables

Use this forum to post Sable related questions.

Moderator: Administrator

Post Reply
KateCN
Junior Member
Posts: 10
Joined: Tue Apr 06, 2010 2:53 pm

Dynamic graphs/tables

Post by KateCN »

Hi,

I'd like to be able to make certain graphs/data tables dynamic. i.e. to allow the user to choose which parameter to display from a small set of parameters.

I've been able to do this with charts by having several buttons which load and unload the various parameters but can't link this to a data table. Also, it would be better to be able to choose from a list rather than have 4/5 buttons on the screen.

I thought I could introduce a dummy variable and graph that/display it in a table. Then use the buttons to set the dummy variable equal to other variables? But I can't find a way to do this.

I'm happy to use VBScript but not sure how to get Sable to read the code. I've saved a simple 'MoveToMainScreen' code in the scripts folder. When I use the Sable script syntax this works fine. But when I rename the file as a vbs file and alter the sytax (copied from Sable help), the Sable project won't open at all. The debugger I'm using doesn't pick up any errors in the code though. Have I misunderstood where to save VBScript code?

Hope this makes sense?!

Kate
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Post by Administrator »

>> I'd like to be able to make certain graphs/data tables dynamic. i.e. to allow the user to choose
>> which parameter to display from a small set of parameters.
>> I've been able to do this with charts by having several buttons which load and unload the
>> various parameters but can't link this to a data table. Also, it would be better to be able to
>> choose from a list rather than have 4/5 buttons on the screen.
>> I thought I could introduce a dummy variable and graph that/display it in a table. Then use the
>> buttons to set the dummy variable equal to other variables? But I can't find a way to do this.
You could have the table show some Sable string vars, then set these to display what you want. You will probably want to set the string var in script before displaying the table.

>> I'm happy to use VBScript but not sure how to get Sable to read the code. I've saved a
>> simple 'MoveToMainScreen' code in the scripts folder. When I use the Sable script syntax this
>> works fine. But when I rename the file as a vbs file and alter the sytax (copied from Sable help),
>> the Sable project won't open at all. The debugger I'm using doesn't pick up any errors in the
>> code though. Have I misunderstood where to save VBScript code?
VBS should go into the scripts sub-directory of your project. It should automatically be read in when the project opens.

Give me a couple of hours and I'll generate a demo on how to do all this stuff.

Tony.
KateCN
Junior Member
Posts: 10
Joined: Tue Apr 06, 2010 2:53 pm

Post by KateCN »

Thanks, that would be helpful.
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Post by Administrator »

This demo uses SableScript. Sablescript is not as easy to use as VBS/JScript, but on some machines (especially managed machines), VBS has been disabled. SableScript will still work in this case.

You will need the latest version of Sable for this to work correctly (click "Help->Check for updates" from Sable).

Tony.
Attachments
Table and script demo.zip
(27.25 KiB) Downloaded 465 times
KateCN
Junior Member
Posts: 10
Joined: Tue Apr 06, 2010 2:53 pm

Post by KateCN »

Great, thanks for this.

Do you have some kind of documentation for the commands available in SableScript? Some of those used in this example aren't listed in the help file. Are there many others?! For example, is there a similar way of refering to values selected in a multi-select list box (i.e. list box based on a subscript)?

Kate
Post Reply