Accessing the value of Array[x] Of String[x] STILL BROKEN

Beta Testing discussion on mikroPascal PRO for AVR.
Post Reply
Author
Message
pykedgew
Posts: 164
Joined: 10 Dec 2005 02:22
Location: Brisbane Australia

Accessing the value of Array[x] Of String[x] STILL BROKEN

#1 Post by pykedgew » 11 Dec 2008 01:07

Hi

With reference to my old thread http://www.mikroe.com/forum/viewtopic.php?t=12315
This program is still not working & had not been responded since Nov 2007.
So I am putting it up here again, to see if there is any solution.
Or has this been an oversight in the redevelopment or a bug.

This short program will not compile

Code: Select all

program DAY;
{  MCU         : ATmega16
   Oscillator  : 10 MHz, External
   SW          : mikroPascal PRO for AVR  }

var
  DOW   : String[3];
  Temp  : Byte;

const
  Day_Of_Week : array[1..7] of String[3] = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat');

{ M A I N    P R O G R A M }
begin
  Temp := 0;

  for Temp := 1 to 7 do
    begin
      DOW := Day_Of_Week[Temp];
    end;

end.
The error message I received is
0 1 mPAVR.exe -DBG -pATMEGA16 -MSF -O11111114 -fo10 -N"C:\Program Files\Mikroelektronika\mikroPascal PRO for AVR\Tryout\WD\DAY.mppav" -SP"C:\Program Files\Mikroelektronika\mikroPascal PRO for AVR\Defs\" -SP"C:\Program Files\Mikroelektronika\mikroPascal PRO for AVR\Uses\LTE64KW\" -SP"C:\Program Files\Mikroelektronika\mikroPascal PRO for AVR\Tryout\WD\" "__Lib_Math.mcl" "__Lib_MathDouble.mcl" "__Lib_System.mcl" "__Lib_Delays.mcl" "DAY.mpas"

0 132 Compilation Started C:\PROGRAM FILES\MIKROELEKTRONIKA\MIKROPASCAL PRO FOR AVR\TRYOUT\WD\DAY.mpas

11 304 Syntax error: Expected ";" but "=" found DAY.mpas

11 304 Syntax error: Expected "." but "(" found DAY.mpas

0 102 Finished (with errors): 11 Dec 2008, 09:38:23 DAY.mppav
Assigning the array of string as part of const is fine.
But when it hit the line 'DOW := Day_Of_Week[Temp]', it complained.
Basically I have given up in this area, as I feel this is pretty crucial to any user who want to assign array for repetition work instead of repeating strings table for controlling LCD display.

Maybe I should asked the question other way round.
Does this compiler handle this operation ?
if yes
then it must be a bug
else
if no
add this function (string array handling) for the next version.

Ken

User avatar
marko.ziv
mikroElektronika team
Posts: 531
Joined: 06 Dec 2007 10:11
Contact:

#2 Post by marko.ziv » 11 Dec 2008 13:17

Hi,

we were able to reproduce this problem
and it will be fixed for the final release.
Thank you for reporting this.

Regards

pykedgew
Posts: 164
Joined: 10 Dec 2005 02:22
Location: Brisbane Australia

#3 Post by pykedgew » 11 Dec 2008 13:26

Hi Marko

Thanks, I will be testing this when the next release appear.

Ken

pykedgew
Posts: 164
Joined: 10 Dec 2005 02:22
Location: Brisbane Australia

Solution For the Moment

#4 Post by pykedgew » 22 Jan 2009 00:53

Update

There is a work around solution to this problem.

yo2lio [Florin] has presented the code that can be used in the link below.

http://www.mikroe.com/forum/viewtopic.php?t=18097
Topics: const array of string buggy? [SOLVED]


So hopefully the mE Team will have the fix for the next release.

Thanks to yo2lio :)

Ken

User avatar
srdjan
mikroElektronika team
Posts: 1552
Joined: 28 Dec 2005 12:47
Location: Serbia

Re: Solution For the Moment

#5 Post by srdjan » 22 Jan 2009 10:51

Hi pykedgew.
This bug was solved a few days after you have reported it.
But then we decided to do aggregate (array, record) copying using system routine rather than generating inline code for a loop each time aggregate copying takes place.
And that is when little gremlins made their comeback :(
Sorry about this.
I have fixed this bug (once again). Until the next release, you should use Florin's workaround.
Thank you for understanding.

pykedgew
Posts: 164
Joined: 10 Dec 2005 02:22
Location: Brisbane Australia

#6 Post by pykedgew » 22 Jan 2009 23:39

Hi srdjan

Sad, as it did happen.
It was great that Florin gave the solution for the moment.

You are going to pay him (for fixing) or me(for identifying the gremlins) money? :wink:

Cheers
Ken

User avatar
srdjan
mikroElektronika team
Posts: 1552
Joined: 28 Dec 2005 12:47
Location: Serbia

#7 Post by srdjan » 23 Jan 2009 11:10

pykedgew wrote: You are going to pay him (for fixing) or me(for identifying the gremlins) money?
Just tell me where should I wire the money ;)

Post Reply

Return to “mikroPascal PRO for AVR Beta Testing”