cONST TO CASE

Post your requests and ideas on the future development of mikroPascal PRO for PIC.
Post Reply
Author
Message
alcidesramos
Posts: 272
Joined: 17 Feb 2009 02:39
Location: Colombia
Contact:

cONST TO CASE

#1 Post by alcidesramos » 02 May 2009 00:26

i WISH USE CONTS IN CASE.

EXAMPLE.

CONTS
OPERAR=0;
APAGAR=1;
VAR
ARZ:BYTE;


THEN I LIKE DO:

CASE ARZ OF
OPERAR:
BEGIN
CODE OF OPERAR
END;

APAGAR:
BEGIN
CODE OF APGAR
END;

END;

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

#2 Post by Dany » 02 May 2009 08:16

Hi, this is already possible. The only thing you should know is that, after the "selector" (your constant value) in the case statement, there should be some text (only a comment is already Ok).
Example:

Code: Select all

CASE ARZ OF
  OPERAR:  // <--- comment added 
     BEGIN
         CODE OF OPERAR
     END;

  APAGAR: // <--- comment added
     BEGIN
        CODE OF APGAR
     END;
See also the help file about the case statement.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

alcidesramos
Posts: 272
Joined: 17 Feb 2009 02:39
Location: Colombia
Contact:

Const to case ok

#3 Post by alcidesramos » 02 May 2009 22:02

OK is good.

Post Reply

Return to “mikroPascal PRO for PIC Wish List”