MODULE CountChars1; (* ========================================================================= Example GPCP .NET Console Program Count, one by one, the number of characters in a string Author : Chris Burrows Created: Jan 2007 (c) 2007-2008 CFB Software http://www.cfbsoftware.com/gpcp ========================================================================= *) IMPORT Out, CPmain; VAR count: INTEGER; s: ARRAY 256 OF CHAR; PROCEDURE WriteCount(count: INTEGER; IN msg: ARRAY OF CHAR); BEGIN Out.Int(count, 3); Out.String(msg); Out.Ln() END WriteCount; BEGIN s := 'The quick brown fox jumped over the lazy dog.'; count := 0; WHILE s[count] # 0X DO INC(count) END; WriteCount(count, ' characters') END CountChars1.