VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Copy n-1 number of characters from source string to the target string using lstrcpyn API

by Karthikeyan (187 Submissions)
Category: Windows API Call/Explanation
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Wed 17th January 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Copy n-1 number of characters from source string to the target string using lstrcpyn API

Rate Copy n-1 number of characters from source string to the target string using lstrcpyn API



' Copy the specified n-1 number of characters from source string to the target string 
Dim source As String, target As String  ' the two strings 
Dim retval As Long  ' return value 
source = "Mission Impossible"  ' the source string to copy 
target = Space(7) 
retval = lstrcpyn(target, source, 7) 
target = Left(target, Len(target) - 1)  ' remove the terminating null character 
MsgBox "Source string = " & source 
MsgBox "Target string = " & target 
End 
End Sub

Download this snippet    Add to My Saved Code

Copy n-1 number of characters from source string to the target string using lstrcpyn API Comments

No comments have been posted about Copy n-1 number of characters from source string to the target string using lstrcpyn API. Why not be the first to post a comment about Copy n-1 number of characters from source string to the target string using lstrcpyn API.

Post your comment

Subject:
Message:
0/1000 characters