Page 1 of 1

Nested variable

PostPosted: Sat Sep 07, 2013 11:08 pm
by chromebandit
Hi is it posible to use Special variable table reccount like

[MyDatabaseName.[TableName].$RecCount]" ???


Regards

Re: Nested variable

PostPosted: Sun Sep 08, 2013 5:09 am
by Gaev
chromebandit:

Yes it is ... as is [[dbVariable].[tableVariable].[fieldVariable]]

But I would be careful about specifying such formats as "variables associated with NeoBook Objects (widgets) ... many years ago, I thought it would be a great idea to adopt this strategy ... as it made it very easy to change the name of your Database (alias) and Table names without having to change them in all the scripts ... found out that a change in (say) [fieldVariable] did not trigger a change in the rendering of the associated NeoBook Object.

Re: Nested variable

PostPosted: Sun Sep 08, 2013 5:19 am
by chromebandit
Thanks Gaev - good to know.

Regards

Re: Nested variable

PostPosted: Sun Sep 08, 2013 6:08 pm
by carlos torres
Dear Chromobandit

About using variables the answer is yes.
I follow a Gaev advice many years ago

This is the field on the screen in a text box
[dBListas.LastName]

and this the routine to keep the fields update
Code: Select all
:DatabaseUpdate
        SetVar "[RecPos]" "![DbListas.[tbName].$RecNum]/[DbListas.[tbName].$RecCount]"
        ...///
        SetVar  "[dbListas.LastName]" "[dbListas.[tbName].LastName]"
        SetVar  "[dbListas.Names]" "[dbListas.[tbName].Names]"
Return


Note that [tbName] is your table name that could change at any moment specially if you have many groups with the same data structure.

hopefully it will be useful

regards
carlost

Re: Nested variable

PostPosted: Mon Sep 09, 2013 5:22 am
by chromebandit
Thanks Carlos good information i try it out :)

Best Regards