Keywords (reserved words) differ from mikroPascal?

Beta Testing discussion on mikroBasic PRO for PIC.
Post Reply
Author
Message
Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Keywords (reserved words) differ from mikroPascal?

#1 Post by Dany » 27 Jan 2015 18:20

Hi,

During the translation of some of my libraries from mP to mB I discovered that a number of variable names give the error "invalid identifier", while these names are accepted in mP as variable identifiers.

The identifiers which I discovered to be invalid were (o.a., list is not exhausting):
System, Command, Dir, Asc, Stop (while "start" is accepted), FileAttr, Sqr, Line, Int, Base, Version, Clear, CurDir and WeekDay.

Furthermore these identifier names are not present in the list of "Reserved words".

Why the difference between mB and mP? Or did I do something wrong?

Thanks in advance. :D
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

User avatar
darko.minic
Posts: 747
Joined: 01 Dec 2014 11:10

Re: Keywords (reserved words) differ from mikroPascal?

#2 Post by darko.minic » 28 Jan 2015 16:43

Hello Dany,

Although Basic and Pascal is quite similar, there is some differences, as you can notice in reserved words.

You can see whether words is reserved in your compiler, for example:
If you type Command in your compiler, Command will appear in bold type, that means that word is reserved.

Certainly I will try to investigate why these specific words are not present in the list of "Reserved words".

Regards,
Darko

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: Keywords (reserved words) differ from mikroPascal?

#3 Post by janni » 28 Jan 2015 17:00

darko.minic wrote:Certainly I will try to investigate why these specific words are not present in the list of "Reserved words".
Wouldn't it make more sense to check if these words need to be reserved? Also verifying present list of "Reserved words" wouldn't hurt as it already seems rather abundant compared to compiler needs.

User avatar
darko.minic
Posts: 747
Joined: 01 Dec 2014 11:10

Re: Keywords (reserved words) differ from mikroPascal?

#4 Post by darko.minic » 29 Jan 2015 13:10

Hello,

We will certainly update our list of "Reserved words".

@Janni
I will forward your suggestion to Software Department so they can consider if these words need to be reserved.

Regards,
Darko

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: Keywords (reserved words) differ from mikroPascal?

#5 Post by janni » 29 Jan 2015 14:53

Thank you Darko. It would be nice to have this solved as it's almost 10 years since it has started to bother mB users (see here for example) and the question whether all reserved keywords are necessary was posted many times for all compilers.

@Dany: It seems that keywords were successively added to reserved list just because they're highlighted by the third-party component mE uses in Code Editor. Hence all the keywords that belong to object oriented languages (and even some historical garbage like 'circle' in mB) :( .

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: Keywords (reserved words) differ from mikroPascal?

#6 Post by Dany » 29 Jan 2015 20:37

janni wrote:@Dany: It seems that keywords were successively added to reserved list just because they're highlighted by the third-party component mE uses in Code Editor. Hence all the keywords that belong to object oriented languages (and even some historical garbage like 'circle' in mB) :( .
Ai. What a waste! :cry: Thanks Janni.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Post Reply

Return to “mikroBasic PRO for PIC Beta Testing”