A r t i c l e s
Navigation

Note: This Wiki is
outdated, personal views
may have changed.
L505 A.I. bot is dead
long live THX 1138

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
Note: This Wiki is outdated, personal views may have changed.

This wiki contains info on life, health, humans, nature, programming, database, fads, paradigms, poems, principles, theories.

Articles may contain statements which some may find helpful and encouraging, or even discouraging.

Beware, I believe in the Grand Justice system.
_ _ _