Compiler say ERROR, but where?

Beta Testing discussion on mikroPascal PRO for AVR.
Author
Message
goran.marinkovic
mikroElektronika team
Posts: 265
Joined: 25 Nov 2008 09:09

#16 Post by goran.marinkovic » 12 Mar 2009 15:36

Hi,

Please post this question on our Support Desk:
http://www.mikroe.com/en/support/
And provide us with piece of code in a project like form that can be compiled
(packed in zip or rar format), which demonstrates the issue you are talking about.
Explain your code as much as possible, how it is supposed to work, when error occur,
what I need to do to reproduce your problem, so I can review it for any possible errors and suggestions.
It is important to send all the files in the project folder, so I can recreate your exact settings and flags of MCU.

Regards

goran.marinkovic
mikroElektronika team
Posts: 265
Joined: 25 Nov 2008 09:09

#17 Post by goran.marinkovic » 16 Mar 2009 11:37

Hi,

You treated string type as a char type.
Your code will work if you define (s) as a char,
but if you still want (s) defined as string
you should write your code like this:

Code: Select all

program test;
var s:string[2];
a:byte;

begin
s[0]:='x';
case s[0] of
'x': a:=1;
end;
end.

Regards

luko
Posts: 9
Joined: 26 Feb 2009 14:36
Location: Lübeck, Germany

#18 Post by luko » 16 Mar 2009 12:37

[quote="goran.marinkovic"]Hi,

You treated string type as a char type.
Your code will work ...

No I dont want to use a string variable in a case statement, it was
a mistake of me, using this string type.
I only wanted to mention, that if this mistake occurs, the compiler gives me only very little help, if it informs me, that somewhere in my "thousands lines of codes" an error exists, refusing any hint which error and which codeline ist involved.
Please compile my demo: you will not find a hint.

goran.marinkovic
mikroElektronika team
Posts: 265
Joined: 25 Nov 2008 09:09

#19 Post by goran.marinkovic » 18 Mar 2009 13:15

Hi,

Please post this question on our Support Desk:
http://www.mikroe.com/en/support/
And provide us with piece of code in a project like form that can be compiled
(packed in zip or rar format), which demonstrates the issue you are talking about.
Explain your code as much as possible, how it is supposed to work, when error occur,
what I need to do to reproduce your problem, so I can review it for any possible errors and suggestions.
It is important to send all the files in the project folder, so I can recreate your exact settings and flags of MCU.

Regards

Post Reply

Return to “mikroPascal PRO for AVR Beta Testing”