There is no parallel to the enum in Gambas (I hope one will exist in the
next version) so you have a couple choices. The simplest is to
define Constance for the suit values.

DIM Const Clubs As Integer = 0
DIM Const Diamonds As Integer = 1
....


An enum would help in porting C/C++ libraries to Gambas as well.

Hope that helps

Randall


On Thu, Jan 5, 2012 at 6:47 PM, Dmitriy <dima.malkov.rus...@gmail.com>wrote:

> Can I enable Wrap mode for gb.qt4.editor? If I can't, will It be
> possible soon?
>
>
> P.S.
> I found help system in Gambas2 better then in Gambas3. Samples and
> source of IDE are poor commented :-). So, I don't know, how I can study
> programming Gambas or just understand how samples work. I have no
> resources except mail lists. At my opinion writing console programs is a
> good point to begin studying Gambas. I took a book for C++ (Robert
> Lafore, Object-Oriented Programming in C++ 4-th Ed) and began translate
> programs from It to Gambas. So, when I was translating example of card
> game from 6-th section, I found:
> ------------------------------------------------------
> ///////////////////////
> enum Suit { clubs, diamonds, hearts, spades };
> const int jack = 11;
> const int queen = 12;
> const int king = 13;
> const int ace = 14;
> ///////////////////////
> class card
> {
>     private:
>         int number;
>         Suit suit;
>     public:
>         card() {}
>         card(int n, Suit s): number(n), suit(s) {}
>         void dysplay();
>         bool isEqual(card); //result of comparison two cards
> }
> ///////////////////////
> void card::dysplay()
> {
>     ...
> }
>
> bool card::isEqual(card c2)
> {
>     ...
> }
> ///////////////////////
> ------------------------------------------------------
> I don't know how to translate it the best way. How to work with "ENUM"
> in Gambas?
>
>
> P.P.S.
> Is there anybody, who writes LaTeX often and isn't satisfied with Kile
> and TeXMaker? I want to write LaTeX-editor in Gambas. I want it will
> work like IDE for Gambas3. I think it is not very difficult task.
>
> ------------------------
> Regards,
> Dmitrij Malkov
>
>
> ------------------------------------------------------------------------------
> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
> infrastructure or vast IT resources to deliver seamless, secure access to
> virtual desktops. With this all-in-one solution, easily deploy virtual
> desktops for less than the cost of PCs and save 60% on VDI infrastructure
> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
> _______________________________________________
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



-- 
If you ask me if it can be done. The answer is YES, it can always be done.
The correct questions however are... What will it cost, and how long will
it take?
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to