谁用过 VB 的 StrConv 函数

inshua 2003-02-25 11:25:44
该函数的 API 原型是什么?
提示:好象是 LCMapString,但是没有成功
...全文
69 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
inshua 2003-03-01
  • 打赏
  • 举报
回复
http://www.aspxcn.com/dotnetbbs/View.aspx?fbId=26&Id=6838

根据该帖,应该用 LCMapString,对照

http://www.nifty.ne.jp/forum/fdelphi/samples/00056.html

作为使用方法的参考。但是还没有成功。
inshua 2003-03-01
  • 打赏
  • 举报
回复
http://delphi.ktop.com.tw/topic.asp?topic_id=24565

该问题已经结帖 :P
inshua 2003-03-01
  • 打赏
  • 举报
回复
我试试——找到一个日本人用 LCStrMap 的例子,换成中文的就失败,分特
cobe 2003-02-27
  • 打赏
  • 举报
回复
楼上的,看清楚别人的问题再抄答案行吗?!

“该函数的 API 原型是什么?”你明白什么意思吗?

瞎拽~~整英文的我们就晕了呀?!
naughtyboy 2003-02-26
  • 打赏
  • 举报
回复
Visual Basic for Applications Reference

StrConv Function


Returns a Variant (String) converted as specified.

Syntax

StrConv(string, conversion, LCID)

The StrConv function syntax has these named arguments:

Part Description
string Required. String expression to be converted.
conversion Required. Integer. The sum of values specifying the type of conversion to perform.
LCID Optional. The LocaleID, if different than the system LocaleID. (The system LocaleID is the default.)


Settings

The conversion argument settings are:

Constant Value Description
vbUpperCase 1 Converts the string to uppercase characters.
vbLowerCase 2 Converts the string to lowercase characters.
vbProperCase 3 Converts the first letter of every word in string to uppercase.
vbWide* 4* Converts narrow (single-byte) characters in string to wide (double-byte) characters.
vbNarrow* 8* Converts wide (double-byte) characters in string to narrow (single-byte) characters.
vbKatakana** 16** Converts Hiragana characters in string to Katakana characters.
vbHiragana** 32** Converts Katakana characters in string to Hiragana characters.
vbUnicode 64 Converts the string to Unicode using the default code page of the system.
vbFromUnicode 128 Converts the string from Unicode to the default code page of the system.


*Applies to Far East locales.

**Applies to Japan only.

Note These constants are specified by Visual Basic for Applications. As a result, they may be used anywhere in your code in place of the actual values. Most can be combined, for example, vbUpperCase + vbWide, except when they are mutually exclusive, for example, vbUnicode + vbFromUnicode. The constants vbWide, vbNarrow, vbKatakana, and vbHiragana cause run-time errors when used in locales where they do not apply.

The following are valid word separators for proper casing: Null (Chr$(0)), horizontal tab (Chr$(9)), linefeed (Chr$(10)), vertical tab (Chr$(11)), form feed (Chr$(12)), carriage return (Chr$(13)), space (SBCS) (Chr$(32)). The actual value for a space varies by country for DBCS.

Remarks

When you're converting from a Byte array in ANSI format to a string, you should use the StrConv function. When you're converting from such an array in Unicode format, use an assignment statement.
cobe 2003-02-26
  • 打赏
  • 举报
回复
API我记得是 LStrCov*....什么来着

你查查Lstr开头的函数,我以前用过
inshua 2003-02-25
  • 打赏
  • 举报
回复
是啊,内码转换,还可以用来测字符串长度,在 API 里是怎么实现的?
DELPHI 没有这个函数,用 ACTIVEX DLL 包装倒是可以,不过我需要知道 API。
Wnyu 2003-02-25
  • 打赏
  • 举报
回复
内码转换
sysu 2003-02-25
  • 打赏
  • 举报
回复
Returns a Variant (String) converted as specified.

Syntax

StrConv(string, conversion, LCID)

string Required. String expression to be converted.
conversion Required. Integer. The sum of values specifying the type of conversion to perform.
LCID Optional. The LocaleID, if different than the system LocaleID. (The system LocaleID is the default.)

This example uses the StrConv function to convert a Unicode string to an ANSI string.

Dim i As Long
Dim x() As Byte
x = StrConv("ABCDEFG", vbFromUnicode) ' Convert string.
For i = 0 To UBound(x)
Debug.Print x(i)
Next

1,184

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧