Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
StrLen API?
Message
 
To
10/02/2004 02:00:48
Larry Long
ProgRes (Programming Resources)
Georgia, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00875783
Message ID:
00875785
Views:
23
Hi!
Declare Integer lstrlen in Win32API String @ lpString

cTest = "Hello"+repl(chr(0),10)
nLen = LSTRLEN(cTest) && should return 5
cString = LEFT(cTest, nLen)
?nlen, cString
You could also use AT() function with CHR(0) as expression searched.

>I need to remove trailing chr(0)'s from a null terminated string. I gathered from VFP help that I should be able to do this by...
>
>SET LIBRARY TO STRLEN
>cTest = "Hello"+repl(chr(0),10)
>nLen = STRLEN(cTest) && should return 5
>cString = LEFT(cTest, nLen)
>
>but no such library exists as far as I can tell.
>Can anyone shed any light on this for me?
Previous
Reply
Map
View

Click here to load this message in the networking platform