Problem with 'AT' keyword

General discussion on mikroBasic PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
arco
Posts: 312
Joined: 15 Apr 2008 13:54
Location: The Netherlands

Problem with 'AT' keyword

#1 Post by arco » 27 Sep 2021 13:28

If I define a structure and a character array at the same position:

Code: Select all

 Structure Blk
   Dim PPCheck        As Char[5]
       PPAmount       As Char[8]
       PPMin          As Char[5]
       VolSpkr        As Char[5]
       VolMicr        As Char[5]
       ConnectMax     As Char[5]
       HotDialDel     As Char[5]
       Provider       As Char[5]
       OutTime        As Char[5]
       InState        As Char[5]
       MeldTijd       As Char[5]
       OK             As Word
       HotdialNr      As Char[16]
       MeldNr         As Char[16]
       SMSNr          As Char[16]
       MenuPin        As Char[8]
       PPPrefix       As Char[8]
       Allowed        As Char[160]
       Contact        As Char[160]
       OutRepeat      As Char[5]
End Structure

Dim Parm              As Blk
Dim ParmBuff          As Char[580] At Parm
the program hangs directly after startup. If I omit the 'At Parm', everything is OK.
Why doesn't it work? I need to be able to address the memory area as separate parameters, and as a continous character array.
(this for writing the struct contents to flash)

If I check with statistics, they are neatly defined at the same memory location...
Regards,

Peter.

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Problem with 'AT' keyword

#2 Post by filip » 01 Oct 2021 08:51

Hi,

Please attach the minimal project that represents this issue.

Regards,
Filip.

Thomas.Pahl@t-online.de
Posts: 158
Joined: 24 May 2008 15:55
Location: Germany

Re: Problem with 'AT' keyword

#3 Post by Thomas.Pahl@t-online.de » 01 Oct 2021 13:34

Interesting question. The examples only show the alias with ports and sbits. Does 'at' only work with simple types?

If you want a variable at the adress of another why not use the 'absolute' directive.

Post Reply

Return to “mikroBasic PRO for dsPIC30/33 and PIC24 General”