Liberty BASIC Help Online |
Winstring(Ptr)
Winstring(structName.pointer$.struct)
Winstring(pointer)
Description:
The WINSTRING( ) function returns a string when a function returns a pointer to a string. This function is especially useful when retrieving the text string from a STRUCT that has been altered by a function, or when an API function returns a pointer to a text string in memory.
Usage:
struct demo,_
name$ as ptr,_
length as long
call DoDemo "hello"
print "Uppercase string is"
print winstring(demo.name$.struct)
print "Length of string is"
print demo.length.struct
sub DoDemo avar$
demo.name$.struct=upper$(avar$)
demo.length.struct=len(avar$)
end sub
'OUTPUT
Uppercase string is
HELLO
Length of string is
5
Copyright (C) 2003 Shoptalk Systems
Liberty BASIC - http://www.libertybasic.com/