WSTR
- 来源: https://www.freebasic.net/wiki/wikka.php?wakka=KeyPgWstr
- 最后更新: 2016-03-13
返回数字或 ASCII 字符串的宽字符串表示形式
语法
vb
declare function Wstr ( byval n as byte ) as wstring
declare function Wstr ( byval n as ubyte ) as wstring
declare function Wstr ( byval n as short ) as wstring
declare function Wstr ( byval n as ushort ) as wstring
declare function Wstr ( byval n as long ) as wstring
declare function Wstr ( byval n as ulong ) as wstring
declare function Wstr ( byval n as longint ) as wstring
declare function Wstr ( byval n as ulongint ) as wstring
declare function Wstr ( byval n as single ) as wstring
declare function Wstr ( byval n as double ) as wstring
declare function Wstr ( byref str as const string ) as wstring
declare function Wstr ( byval str as const wstring ptr ) as wstring用法
result = Wstr( number )
或
result = Wstr( string )参数
number
要转换为宽字符串的数值表达式。
string
要转换为宽字符串的字符串表达式。
返回值
返回数值或字符串表达式的宽字符表示形式。
描述
Wstr 将数值变量转换为其宽字符串表示形式。它是 Str 的宽字符等价函数。
Wstr 还将 ASCII 字符串转换为 Unicode 字符串。如果给定的是宽字符串,则该字符串原样返回。
示例
start GeSHi
vb
#if defined( __FB_WIN32__ )
#include "windows.bi"
#endif
Dim zs As ZString * 20
Dim ws As WString * 20
zs = "Hello World"
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'")
#endifend GeSHi
平台差异
- DOS 不支持
Wstr。
方言差异
- 在 -lang qb 方言中不可用,除非使用别名
__Wstr引用。
与 QB 的区别
- FreeBASIC 新增
参见
StrWstring
返回 目录