我知道,这是一个菜鸟问题,但是.....我不知道:(
我正在使用 dotnet-gnat,我在使用平台命令时遇到了问题。 Net in Ada ...我可以使用 WriteLine,但我不能使用 ReadLine 命令...。 如何知道一些命令的正确使用方法?
我的代码:
with Ada.Text_IO, MSSyst.Console;
use Ada.Text_IO, MSSyst.Console;
procedure ada_net is
begin
Put("Ola mundo");
New_line;
WriteLine("Ola mundo");
--ReadLine;
end ada_net;
ReadLine代码:
function ReadLine return access MSSyst.String.Typ'Class;
pragma Export (CIL, ReadLine, "ReadLine");
谢谢。
最佳答案
with
MSSyst.String,
MSSyst.Console,
Ada.Text_IO;
procedure Test is
begin
Ada.Text_IO.Put_Line( "Dotnet test." );
Ada.Text_IO.Put( "Enter a line: " );
declare
Line : access MSSyst.String.Typ'Class renames MSSyst.Console.ReadLine; --'
use MSSyst.String;
Function "&"( Left, Right : access Typ'Class ) return access Typ'Class renames Concat;
Function "&"( Left : String; Right : access Typ'Class ) return access Typ'Class is
( (+Left) & Right );
begin
MSSyst.Console.WriteLine( ("You entered: """ & Line) & (+(1=> '"')));
end;
end Test;
关于.net - 在 Ada 中使用 .net 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8141727/