在Ada中使用.net命令

问题描述 投票:3回答:1

我知道,这是一个菜鸟问题,但.....我不知道:(

我正在使用dotnet-gnat,我在使用平台的命令时遇到了麻烦。在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");

谢谢。

.net ada gnat
1个回答
2
投票
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;
© www.soinside.com 2019 - 2024. All rights reserved.