[Pas2js] nonconsecutive enumeration not implemented

warleyalex warleyalex at yahoo.com.br
Wed Feb 14 18:32:33 CET 2018


While writing pas2js help, I've came across we can not use nonconsecutive
enums "not implemented"

type
  TSuit = (Hearts = 1, Clubs, Diamonds = 10, Spades); 

var
  suit: TSuit;
  suitEnum: array [1..4] of TSuit;
  i : Integer = 0;
begin
//initialization
suitEnum[1] := Hearts;
suitEnum[2] := Clubs;
suitEnum[3] := Diamonds;
suitEnum[4] := Spades;
 
// nonconsecutive enumeration
for suit in suitEnum do
  begin
    i := i + 1;
    WriteLn('Myenum'+ IntToStr(i) +'= '+ IntToStr(Ord(suit)));
  end;

OUTPUT:
Myenum1= 1
Myenum2= 2
Myenum3= 10
Myenum4= 11 




--
Sent from: http://pas2js.38893.n8.nabble.com/


More information about the Pas2js mailing list