t_id
175
t_adddate
2003/10/03
t_result
0
t_knownrunerror
0
Record count: 50
Total = 50
OK=50 Percentage= 100.00
{****************************************************************} { CODE GENERATOR TEST PROGRAM } {****************************************************************} { NODE TESTED : secondtypeconvert() -> second_cstring_to_pchar } {****************************************************************} { PRE-REQUISITES: secondload() } { secondassign() } { secondtypeconv() } {****************************************************************} { DEFINES: } { FPC = Target is FreePascal compiler } {****************************************************************} { REMARKS: } { } { } { } {****************************************************************} {$H-} const StrConst = 'HELLO WORLD'; AnsiConst = 'COCORICCO!'; AnsiConst2 = ''; procedure testcstring2pcharone; var p1 : pchar; begin WriteLn('(left) : LOC_MEM; (right) : LOC_MEM'); p1 := pchar(strconst); WriteLn('Value should be ''HELLO WORLD''...',p1); end; { source: } { LOC_REFERENCE, LOC_MEM } { destination: } var p: pchar; Begin WriteLn('------------------- STRING/PCHAR ------------------------'); WriteLn('(left) : LOC_MEM; (right) : LOC_MEM'); { LOC_MEM -> LOC_MEM test } { SHORTSTRING -> PCHAR } p := pchar(strconst); WriteLn('Value should be ''HELLO WORLD''...',p); testcstring2pcharone; WriteLn('------------------- ANSI/PCHAR ------------------------'); WriteLn('(left) : LOC_MEM; (right) : LOC_MEM'); p:=pchar(ansistring(ansiconst)); WriteLn('Value should be ''COCORICCO!''...',p); p:=pchar(ansistring(ansiconst2)); WriteLn('Value should be ''''...',p); End. { $Log: tcnvstr2.pp,v $ Revision 1.2 2002/09/07 15:40:55 peter * old logs removed and tabs fixed }