[fpc-pascal] Syntax problem with first unit

Tomas Hajny XHajT03 at mbox.vol.cz
Sun Apr 5 16:33:37 CEST 2009


On Sun, April 5, 2009 16:03, Francisco Reyes wrote:
> Mehmet Erol Sanliturk writes:
>
>> Unit and function names DebugPrint are the same .
>> Pascal is case insensitive . Making their cases different does NOT
>> make them different .
>>
>> Please make them different and retry .
>
> Thanks. That worked.
>
> It may help newcomers like myself if this was mentioned on the ref
> document.
> Just double checked and it does not mention this.
>
> Likely an error that people will only commit once, but still would be nice
> to have int he ref doc.

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





More information about the fpc-pascal mailing list