gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gm2] ProgramArgs problem


From: Christoph Schlegel
Subject: [Gm2] ProgramArgs problem
Date: Sat, 6 Apr 2013 15:27:09 +0200

Hello Gaius,

My gm2 build is gm2-1.0.5 ((20130107) grafted onto GCC 4.1.2), 
CYGWIN_NT-6.1-WOW64.

I am experiencing unexpected behaviour of ProgramArgs. An exception (out of 
range) was raised everytime I started my program with a command line argument 
(only then). After removing exception handling executing the program with an 
argument ended in an endless loop. So I fell back to the usual example used to 
demonstrate the use of ProgramArgs:

MODULE pa;
IMPORT ProgramArgs, TextIO, STextIO, IOResult;
VAR
  str: ARRAY [0..49] OF CHAR;
  cid: ProgramArgs.ChanId;
BEGIN
  cid:=ProgramArgs.ArgChan();
  WHILE ProgramArgs.IsArgPresent() DO
        TextIO.ReadToken(cid,str);
        STextIO.WriteString(str);
        STextIO.WriteLn;
  END; (* WHILE *)  
END pa.

Same as before, the program works without parameters, as soon as one is 
provided, behaviour as described.

Thanks in advance!

Regards,
Christoph




reply via email to

[Prev in Thread] Current Thread [Next in Thread]