schrei
2007-07-25 20:16:58 UTC
Hallo!
I?m trying to translate a borland pascal sample program to gpcp.
The lines "Sys.Console.WriteLine(myEnumerator.Current);" and
"Sys.Console.WriteLine(myStack.Count);" does not compile. Why does it
not compile?
The delphi sample programm is here
http://delphi.about.com/library/fcl/system/collections/blfclstack.htm
Kind regards
Helmut
MODULE SamplesStack;
IMPORT Col := mscorlib_System_Collections, Sys := mscorlib_System, CPmain;
VAR myStack : Col.Stack;
PROCEDURE PrintValues(myCollection: Col.IEnumerable);
VAR myEnumerator: Col.IEnumerator;
BEGIN
myEnumerator := myCollection.GetEnumerator;
WHILE myEnumerator.MoveNext DO
Sys.Console.WriteLine(myEnumerator.Current);
END;
Sys.Console.WriteLine;
END PrintValues;
BEGIN
NEW(myStack );
myStack .Push("Hallo");
Sys.Console.WriteLine(myStack);
Sys.Console.WriteLine(myStack.Count);
PrintValues(myStack);
END SamplesStack.
I?m trying to translate a borland pascal sample program to gpcp.
The lines "Sys.Console.WriteLine(myEnumerator.Current);" and
"Sys.Console.WriteLine(myStack.Count);" does not compile. Why does it
not compile?
The delphi sample programm is here
http://delphi.about.com/library/fcl/system/collections/blfclstack.htm
Kind regards
Helmut
MODULE SamplesStack;
IMPORT Col := mscorlib_System_Collections, Sys := mscorlib_System, CPmain;
VAR myStack : Col.Stack;
PROCEDURE PrintValues(myCollection: Col.IEnumerable);
VAR myEnumerator: Col.IEnumerator;
BEGIN
myEnumerator := myCollection.GetEnumerator;
WHILE myEnumerator.MoveNext DO
Sys.Console.WriteLine(myEnumerator.Current);
END;
Sys.Console.WriteLine;
END PrintValues;
BEGIN
NEW(myStack );
myStack .Push("Hallo");
Sys.Console.WriteLine(myStack);
Sys.Console.WriteLine(myStack.Count);
PrintValues(myStack);
END SamplesStack.