fpc/tests/webtbs/tw15504.pp
Jonas Maebe 08a4ede9c4 * added str(enum,charray) and export str(enum,ansistr/widestr/unicodestr)
(mantis #15504)
  * fixed result parameter of str(enum,ansistr) helper (was shortstring)

git-svn-id: trunk@14629 -
2010-01-12 20:19:52 +00:00

33 lines
516 B
ObjectPascal

program strtest;
{$MODE OBJFPC}
{$LONGSTRINGS ON}
{$ifdef unix}
uses CWstring;
{$endif}
type
tEnum = (North, East, South, West);
var s0: shortstring;
s1: widestring;
s2: ansistring;
s3: array[3..7] of char;
e: tEnum;
begin
e := West; Str(e, s0);
if s0<>'West' then
halt(1);
e := East; Str(e, s1);
if s1<>'East' then
halt(2);
e := South; Str(e, s2);
if s2<>'South' then
halt(3);
e:= North; Str(e, s3);
if s3<>'North' then
halt(4);
end.