[Lazarus] installing chm help

Sven Barth pascaldragon at googlemail.com
Wed Feb 15 12:07:21 CET 2012


Am 15.02.2012 11:30, schrieb Hans-Peter Diettrich:
> waldo kitty schrieb:
>
>> also basic things like 'writeln', 'write', and similar do not give any
>> help... but then some stuff, like 'integer' popup with a "Help
>> selector" window as mentioned above and one of the two RTL (ahh! found
>> a RTL[] hit) options (objpas.pp) talks about "redefinition of integer
>> as 32-bit type" whereas the other one (systemh.inc) says "a signed
>> 16-bits integer"...
>>
>> so which one is correct?
>
> IMO "Integer" is a compiler built-in type, and thus it doesn't have a
> reference to the current declaration. The same for Char and string types
> :-(
>

You don't like to validate your assumptions, do you?

rtl/inc/systemh.inc, line 87:

Type
   { The compiler has all integer types defined internally. Here
     we define only aliases }
   DWord    = LongWord;
   Cardinal = LongWord;
   Integer  = SmallInt;
   UInt64   = QWord;

and rtl/objpas/objpas.pp, line 24:

     { first, in object pascal, the integer type must be redefined }
     const
        MaxInt  = MaxLongint;
     type
        Integer  = longint;


> I already mentioned that flaw, and suggested conditional declarations:
> {$IFDEF fpdocsystem}
> type
> integer = LongInt;
> cardinal = LongWord;
> ...
> char = WideChar;
> string = UnicodeString;
> ...
> {$ENDIF}
>
> In my own docs I added topics for all basic types. Common to all these
> workarounds is the missing correspondence to the effective declarations,
> so that "a signed 16-bits integer" entry will survive ad nauseam, if
> nobody happens to find and update such entries. E.g. AnsiChar is
> described as an alias for Char, which in fact should read the opposite
> way, and nowadays even Char=WideChar.
>
> I found no time yet to create an overview of all the basic (built-in)
> types, which would allow to update all these types in one single place,
> whenever the declarations are changed in the compiler.

For the other types this is indeed true...

>> why does basic stuff, eg: 'write' and 'writeln' not have any help at all?
>
> Thanks, I didn't realize that yet. It's for the same reason: these are
> compiler magics, for which FPDoc doesn't find a declaration in the
> source code, and consequently ignores all such <element>, even if they
> exist in the XML files. See above for possible workarounds.

And again you didn't do a validation: Write and Writeln ARE documented. 
I don't know currently how Michael did it, but they are in the RTL 
documentation.

>> where is the help for items like 'PadRight', 'AddChar', 'PadLeft',
>> 'AddCharR' and similar??
>
> I just can't find in which units these are declared. The FCL is only
> documented to a small percentage, perhaps these functions reside in such
> undocumented units?

Open lHelp, go to "Search", enter "PadRight", be happy.

Alternatively in Google: "padright site:freepascal.org" (which will lead 
you to the documentation as well).

They are all declared (and documented) in StrUtils which belongs to the RTL.

>> remember, "we" are coming at this as a pure newbie with some coding
>> knowledge, no books, and an extremely simple background in
>> programing... yes, much of the basic stuff really does need to be
>> specified ;)
>
> Please create an according FPC bug report, if none exists yet, and hope
> that somebody will update the documentation.

Please validate first by either checking the documentation by hand 
(using lHelp's search) or using "IDENTIFER site:freepascal.org" on Google.

Regards,
Sven




More information about the Lazarus mailing list