StrStr different behaviour

General discussion on mikroPascal for dsPIC30/33 and PIC24.
Post Reply
Author
Message
jpc
Posts: 1986
Joined: 22 Apr 2005 17:40
Location: France 87

StrStr different behaviour

#1 Post by jpc » 02 Apr 2009 12:50

while converting some existing P18 code to P30 i found some undocumented difference in the behaviour of StrStr() function. According to the help ( identical in both) the prototype is : function strstr(var s1, s2 : string[100]) : word; On PIC this does not allow s1 to be in ROM so i made an equivalent search on match in ROM by using a Const-pointer . On P30 however, this seems to result in some trap , resulting in a reset so merely out of curiosity i checked StrStr() there and to my surprise it works ok. Can someone explain to me the difference in memory-access, i presume this will also be valid for other functions using var-parameters.
If legal it should be updated in the help.
Au royaume des aveugles, les borgnes sont rois.

Post Reply

Return to “mikroPascal for dsPIC30/33 and PIC24 General”