program ZMDemoConsole;

{$APPTYPE CONSOLE}

uses
  SysUtils,
  uDemoReadConfig in 'uDemoReadConfig.pas',
  NativeXml in '..\..\Source\NativeXml.pas',
  ZaphodsMap in '..\..\Source\ZaphodsMap.pas',
  ZaphodsMapMessages in '..\..\Source\ZaphodsMapMessages.pas',
  UTF8StringUtils in '..\..\Source\UTF8StringUtils.pas';

var
  ACaption, AResult, AWarning: string;

begin
  try
    WriteLn('ZMDemo - Console Version');
    WriteLn('');
    AResult := ReadZMEnvVar(ACaption);
    WriteLn(ACaption + #9 + AResult);
    WriteLn('');

    AResult := ReadConfig1(ACaption, AWarning);
    WriteLn(ACaption + #9 + AResult);
    if AWarning <> '' then
      WriteLn(#9 + 'Warning: ' + AWarning);
    WriteLn('');

    AResult := ReadConfig2(ACaption, AWarning);
    WriteLn(ACaption + #9 + AResult);
    if AWarning <> '' then
      WriteLn(#9 + 'Warning: ' + AWarning);
    WriteLn('');

    AResult := ReadConfig3(ACaption, AWarning);
    WriteLn(ACaption + #9 + AResult);
    if AWarning <> '' then
      WriteLn(#9 + 'Warning: ' + AWarning);
    WriteLn('');

    AResult := ReadConfig4(ACaption, AWarning);
    WriteLn(ACaption + #9 + AResult);
    if AWarning <> '' then
      WriteLn(#9 + 'Warning: ' + AWarning);
    WriteLn('');
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
end.
