[V4REV] symbolic constants // Based on Assoc Array

Ruslan Zasukhin sunshine at public.kherson.ua
Mon May 16 19:01:15 CDT 2005


On 5/16/05 6:39 PM, "Robert Brenstein" <rjb at robelko.com> wrote:

> I am not sure which part bothers you. Unlike in other environments,
> they constants in rev are mostly for mnemonic/code readibility since
> they are not true enums.
> 
> When I switched to MetaCard/Rev, I used to create separate global var
> for each global value I needed. That was the HyperCard way. Then I
> discovered associative arrays. So much easier to handle things like
> preferences or global values. Particularly nice since they couple so
> strongly and well with custom properties. But it is a different frame
> of mind than programming in RB or C/C++, so I can see why it feels
> odd to you.
> 
> If you wanted to go all the way, instead of defining constants on our
> side (in our program), you could have Valentina functions accept
> literals instead of, or in addition to, numerical parameters and have
> your external converting these literals into numbers.

Oh! Btw, this is also a way

> Then the whole issue of val-related globals is out of window. And the
> constants are documented clearly and individually for each Valentina call.
> This would be a proper emulation of enums in Transcript IMHO.

so: 

We can use this way: very similar to Java/RB.

    SQlSelect( query,
        "EVCursorLocation.kServerSide",
        "EVLocks.kReadWrite",
        "EVCursorDirection.kRandom" )

Of course we can also make it shorter:

    SQlSelect( query, "kServerSide", "kReadWrite", "kRandom" )

well, I think second way you will prefer better, right ?

Only it needs to check if all constant names from different "enums" are
different...


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list