WStr
 
返回数字或ASCII字符串的宽字符字符串表示形式

语法
用法

result = WStr( number )
or
result = WStr( string )

参数

number
数字表达式转换为宽字符串。
string
字符串表达式转换为宽字符串。

返回值

返回数字或字符串表达式的宽字符表示形式。

说明

WStr将数字变量转换为宽字符字符串表示形式。相当于Str的宽字符。

WStr也将ASCII字符串转换为Unicode字符串。如果给出了一个宽字符串,则该字符串将不会被修改。

例子

#if defined( __FB_WIN32__ )
#include "windows.bi"
#endif

Dim zs As ZString * 20
Dim ws As WString * 20

zs = "你好,世界"
ws = WStr(zs)

#if defined( __FB_WIN32__ )

MessageBox(null, ws, WStr("Unicode'Hello World'"), MB_OK Or MB_ICONINFORMATION)

#else

Print ws
Print WStr("Unicode'Hello World'")

#endif


平台差异

  • DOS不支持WStr.


方言差异

  • -lang qb 方言中不可用,除非使用别名__Wstr引用。

与QB差别

  • 新的FreeBASIC

参考