"arg out of range" when "adding" a strng record mem [solved]

Beta Testing discussion on mikroPascal PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

"arg out of range" when "adding" a strng record mem [solved]

#1 Post by Dany » 14 Jun 2011 18:50

The code below causes an "argument out of range" error. In the mP PIC compiler this problem was solved in v 3.00 bèta (it gave an "internal error" there).

v4.80 bèta.

Code: Select all

program test24;

// solved in PIC v 3.00 bèta

type TFat16DirItem =
     record
       FileName: string[8];
       FileExt : string[3];
       FileAttr: byte;
       FileSize: DWord;
     end;

var DirItem: TFat16DirItem;
    S1: string[50];

procedure MyDirHandling(var Item: TFat16DirItem);
var Sx: string[50];
    TmpStr: string[20];
 begin
  if Item.FileExt[0] > 0 then
   begin
    Sx := Item.FileName;
    StrAppendSuf(Sx, '.');
    TmpStr := Item.FileExt;   // OK
    Sx := Sx + TmpStr;        // Ok
    Sx := Sx + Item.FileExt;  // <-------------------- causes "argument out of range" error
   end;
 End;{MyDirHandling}

begin
 DirItem.FileName := 'Name';
 DirItem.FileExt := 'ext';
 S1:=DirItem.FileName;
 StrAppendSuf(S1, '.');
 S1:=S1 + DirItem.FileExt;  // no problem here
 MyDirHandling(DirItem);

end.
Thanks in advance!

solved in v5.40
Last edited by Dany on 31 Dec 2011 12:07, edited 1 time in total.
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
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: "argument out of range" when "adding" a string record me

#2 Post by filip » 15 Jun 2011 10:59

Hi,

I have notified our developers regarding this.
Thank you for reporting it.

Regards,
Filip.

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

Re: "argument out of range" when "adding" a string record me

#3 Post by Dany » 31 Dec 2011 12:06

Hi, this issue is solved in v5.40.

Thanks mE and a happy newyear! :D :D :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)

Post Reply

Return to “mikroPascal PRO for dsPIC30/33 and PIC24 Beta Testing”