A r t i c l e s
Navigation

Note: This site is
a bit older, personal views
may have changed.

M a i n P a g e

D i r e c t o r y

Pascal Comment Syntax Problems


The problem:
(*
String:= ' this*)andstuff ' ;

{
String:= ' this}andstuff ' ;

The above code will be partially commented out, even though the *) is in quotes (in 
a string). I noticed this in Lazarus.. the editor does show it as being commented 
out, and the FPC compiler says it's commented out too.

I guess the problem occurs mostly when you use a regex like ' text(.*)text ' and you 
just happen to be commenting out something before that line.

In Delphi 5 the same issues occur. 

If delphi and FPC both have problems with it, it makes me think that maybe this is 
not really an issue.

This does not cause any issues:
 Writeln('Exa(*mple 1:');
 Expression:= 'some*)stuff';

And neither does this:
 TheString:= ' string(*andstuff ' ; *)



About
This site is about programming and other things.
_ _ _