Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Bobby on June 30, 2020, 06:05:09 PM

Title: STRCopy vs MEMCopy
Post by: Bobby on June 30, 2020, 06:05:09 PM
Hello all,

I just updated to 2.7 and see the addition of the new STRCOPY. Was curious why I would choose this vs memcopy which I am using right now. Does it have some advantages I am not seeing right away?
Title: Re: STRCopy vs MEMCopy
Post by: franji1 on June 30, 2020, 07:08:10 PM
MEMCOPY works with strings of same max sizes, e.g. SS0 to SS5.  But it does NOT work with SS0 to SL0 since SL's max length (256) is different than SS (64).

STRCOPY takes any combination of string maxlengths, and when copying shorter max lengths to longer, it just works.  And when copying longer lengths to shorter max lengths, it truncates the longer string to the destination's max length so that memory is not overwritten.