Please enable JavaScript to view this site.

 

str = StrCopy(sString,nStart,nLength)

 

This macro function copies nLength characters from sString, starting at the position nStart.

 

You do not have to check if the values you are passing for nStart and nLength are too high; if they are, they will be ignored.

 

If nStart is larger than the length of sString, then the result will be a blank string.

If nStart+nLength-1 is larger than the length of sString, then the result will only include characters until the end of sString.

StrCopy('Hello',2,1) = 'e'
StrCopy('Hello',2,3) = 'ell'
StrCopy('Hello',2,4) = 'ello'
StrCopy('Hello',2,1000) = 'ello'
StrCopy('Hello',1000,3) = '' // blank

See also: StrDelete.

 


Topic 108275, last updated on 18-Apr-2020