Spin Syntax Question...
jmspaggi
Posts: 629
Hi all,
I'm sure there is a super clean do to what I'm looking for...
Here is the code
What I want to do is to transfert only a certain amount for memory. if strsize(@sd_buffer+cursor)+1 is bigger than 30, I want to limit it to 30. I can put a if before, but is there another way to do something like
This is Java syntax. Not sure for Spin...
Thanks,
JM
I'm sure there is a super clean do to what I'm looking for...
Here is the code
bytemove (lf_number_addr+index, @sd_buffer+cursor, strsize(@sd_buffer+cursor)+1)
What I want to do is to transfert only a certain amount for memory. if strsize(@sd_buffer+cursor)+1 is bigger than 30, I want to limit it to 30. I can put a if before, but is there another way to do something like
bytemove (lf_number_addr+index, @sd_buffer+cursor, strsize(@sd_buffer+cursor)+1>30?30:strsize(@sd_buffer+cursor)+1)
This is Java syntax. Not sure for Spin...
Thanks,
JM
Comments
You could use something like: (strsize(@s)+1)<#30
JM
Page 155 of the manual: