Keywords in TYPEs

General FreeBASIC programming questions.
angros47
Posts: 1673
Joined: Jun 21, 2005 19:04

Keywords in TYPEs

Postby angros47 » May 21, 2020 16:37

Why is

Code: Select all

type foo extends object
   declare sub cls()
end type


while

Code: Select all

type foo extends object
   declare sub end()
end type


gives "error 4: Duplicated definition, found 'end' in 'declare sub end"?
fxm
Posts: 9938
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Keywords in TYPEs

Postby fxm » May 21, 2020 17:59

Perhaps because the symbol name 'end' is also a keyword used to declare the structure itself, in the same way as 'type' and 'extends' also prohibited as names for member symbols.

Return to “General”

Who is online

Users browsing this forum: No registered users and 6 guests