[fpc-pascal] Dot syntax for types?
Michael Van Canneyt
michael at freepascal.org
Sun Jan 14 09:56:32 CET 2018
On Sun, 14 Jan 2018, Ryan Joseph wrote:
> I remember I heard about a mode switch that requires "type groups” (what are these called btw?) to use a . and be prefixed. For example:
>
> type
> TGLType = (GL_FLOAT, GL_UNSIGNED_BYTE);
>
>
> TGLType.GL_FLOAT would be the full name (note GL_FLOAT already is declared so I want the type to be explicitly TGLType.GL_FLOAT in all cases). I need to make some wrappers around OpenGL types and I thought this would be a nice way to do it instead of declaring a bunch of constants with prefixes but I just can’t remember how to handle that dot syntax (maybe it’s in the trunk under development). Thanks.
Try
{$SCOPEDENUMS ON}
see
https://www.freepascal.org/docs-html/current/prog/progsu70.html#x77-760001.2.70
Michael.
More information about the fpc-pascal
mailing list