[Gambas-user] Description of symbols as string?

Christof Thalhofer chrisml at ...3340...
Fri Apr 29 00:54:47 CEST 2016


Am 28.04.2016 um 22:08 schrieb Benoît Minisini:

> There is no good reason to insert comments inside the generated code, 
> even if these comments are help comments. It would not be comments 
> anymore then.

Yes I understand.

> Why do you need that?

I have a (old – ported to Gambas) right-system based on a class "Allow"
with constants as flags like so:

Public Const This As Integer = 1
Public Const That As Integer = 2
Public Const Else As Integer = 4
Public Const Any  As Integer = 8
...

And a form where I display the constants names and let the chief choose,
whether the employee can have:

Allow.This and Allow.That but not Allow.Else ...

This or That or Else is based on the names of the constants which are
displayed in the form. I'd like to give the chief some more information,
like

This = "The employee can do this, what causes a lot of things like ..."

And so I thought that I can do in code:

'' The employee can do this, what causes a lot of things like ...
Public Const This As Integer = 1

And use that in my program. It would be an elegant way to declare
constants, and keep the meaning of them together.


Alles Gute

Christof Thalhofer

-- 
Dies ist keine Signatur




More information about the User mailing list