Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-11

Parameter with no type defined?

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

If I have a declaration as follows... what type is InData and OutData? Pointers? If it is a generic Pointer type, then why doesn't developers simply declare it as pointer? What is the advantage of not mentioning the type then?

procedure TDCP_blowfish.EncryptECB(const InData; var OutData);
begin
...
end

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email

dmitry boyarintsev
to Graeme Geldenhuys
Graeme Geldenhuys wrote
If I have a declaration as follows... what type is InData and OutData? Pointers? If it is a generic Pointer type, then why doesn't developers simply declare it as pointer? What is the advantage of not mentioning the type then?

if you declare parameter as Pointer, then you might be able to pass "nil" So the function should keep that possibility in mind.

Declaring parameter as untype shows that parameter is mandatory.

thanks,
dmitry

Reply by email

Graeme Geldenhuys
to dmitry boyarintsev
dmitry boyarintsev wrote
if you declare parameter as Pointer, then you might be able to pass "nil" So the function should keep that possibility in mind. Declaring parameter as untype shows that parameter is mandatory.

Thanks for the quick response. I looked in the Language Reference documentation for FPC and couldn't find any mention of that. It simply states that untyped parameters are not compatible with any other types and must be cast before used.

I'll point this out to Michael van Canneyt.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email