Warning

You're browsing the old v2.x documentation. This version is no longer maintained. Click here to go the v3.x documentation.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
strncpy [2019/05/22 22:08] neilsstrncpy [2019/05/23 08:32] neils
Line 21: Line 21:
  
   10 a$="hello world"   10 a$="hello world"
-  20 b$=right$(a$, 5)+  20 b$=mid$(a$, 4, 3)
   30 print b$   30 print b$
      
Line 29: Line 29:
   dim buffer![6]   dim buffer![6]
   b$ = @buffer!   b$ = @buffer!
-  strcpy b$, a$+(strlen!(a$)-5)+  strcpy b$, a$+4, 3
   print b$   print b$
      
-Both programs will output "world".+Both programs will output "o w".
      
 **Important note**: The routine will not stop copying at the end of //destination// which may lead to an overflow situation. You have to make sure that there is enough memory at the destination. **Important note**: The routine will not stop copying at the end of //destination// which may lead to an overflow situation. You have to make sure that there is enough memory at the destination.