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

Produces:

  Uppercase string is
  HELLO
  Length of string is
  5