Tomas Hajny wrote:

Note that although having the unit named equally to a function, procedure
or a variable defined within the unit (or elsewhere) is not really
advisable, it is possible, but you need to take scoping rules into account
when trying to access the function, procedure or variable. In your
particular case, you would need to use DebugPrint.DebugPrint (your
parameters) in order to tell the compiler that you refer to the function
DebugPrint stored within unit DebugPrint referenced in the "uses" section.
That's also why the compiler suggested that you should use '.' after
DebugPrint.

Tomas


The following addition may be made to the above explanation for a little more clarification :

When compiler scanned the assignment statement := , it found the name DebugPrint . Within the scope of the program DebugPrint is a unit name whereas there should be a variable name . For that reason , the compiler assumed that there should be a qualification of a variable name by the unit name such as

... := DebugPrint . x ...

Instead of finding a period and variable name after the unit name DebugPrint , it found a left parenthesis .

Due to this , it gave the message ... Expected . ( period ) but found ( left parenthesis ) .

Thank you very much .

Mehmet Erol Sanliturk








_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to