Comparison of Pascal and Delphi: Difference between revisions

Content deleted Content added
m clean up
m Task 70: Update syntaxhighlight tags - remove use of deprecated <source> tags
Line 16:
4. Given a variant record in Standard Pascal, the size of a particular variant can be specified. Delphi does not support this form of 'sized' dynamic variable allocation:
 
<sourcesyntaxhighlight lang="pascal">
new(p, t) //where t is a variant record tag type; does not compile in Delphi
</syntaxhighlight>
</source>
 
5. The functions 'pack' and 'unpack' are not implemented in Delphi.
Line 24:
6. The Delphi compiler does not treat { and (*, } and *) as synonyms like Standard Pascal requires. In other words,
 
<sourcesyntaxhighlight lang="delphi">
{ comment *)
</syntaxhighlight>
</source>
 
is not valid in Delphi. Instead, Delphi uses the scheme of allowing the different comment types to indicate nested comments.
Line 34:
8. Numbers and booleans are not printed out in their 'default' field widths by Delphi's version of the Write and WriteLn standard procedures, being instead printed in the minimum amount of space. For example, in Delphi,
 
<sourcesyntaxhighlight lang="delphi">
write(5);
write(55);
</syntaxhighlight>
</source>
 
is equivalent to:
 
<sourcesyntaxhighlight lang="pascal">
write(5:1);
write(55:2);
</syntaxhighlight>
</source>
 
However, Standard Pascal requires it to be equivalent to the following (TotalWidth is implementation-defined):
 
<sourcesyntaxhighlight lang="pascal">
write(5:TotalWidth);
write(55:TotalWidth);
</syntaxhighlight>
</source>
 
Similarly, for booleans,
 
<sourcesyntaxhighlight lang="pascal">
write(false);
write(true);
</syntaxhighlight>
</source>
 
is equivalent to
 
<sourcesyntaxhighlight lang="delphi">
write('false':5);
write('true':4);
</syntaxhighlight>
</source>
 
in Delphi, but
 
<sourcesyntaxhighlight lang="pascal">
write('false':TotalWidth);
write('true':TotalWidth);
</syntaxhighlight>
</source>
 
in ISO 7185.