怎么将如下VB代码转换成delphi代码(200分)

  • 主题发起人 主题发起人 xiongw
  • 开始时间 开始时间
X

xiongw

Unregistered / Unconfirmed
GUEST, unregistred user!
Private Declare Function LCMapString Lib &quot;kernel32&quot; Alias &quot;LCMapStringA&quot; (ByVal Locale As Long, ByVal dwMapFlags As Long, ByVal lpSrcStr As String, ByVal cchSrc As Long, ByVal lpDestStr As String, ByVal cchDest As Long) As Long<br>Private Declare Function lstrlen Lib &quot;kernel32&quot; Alias &quot;lstrlenA&quot; (ByVal lpString As String) As Long<br><br><br>'简转繁<br><br>Public Function JToF(ByVal Str As String) As String<br> &nbsp; &nbsp;Dim STlen As Long<br> &nbsp; &nbsp;Dim STf As String<br> &nbsp; &nbsp;STlen = lstrlen(Str)<br> &nbsp; &nbsp;STf = Space(STlen)<br> &nbsp; &nbsp;LCMapString &H804, &H4000000, Str, STlen, STf, STlen<br> &nbsp; &nbsp;JToF = STf<br>End Function<br><br><br><br>'繁转简<br><br>Public Function FToJ(ByVal Str As String) As String<br> &nbsp; &nbsp;Dim STlen As Long<br> &nbsp; &nbsp;Dim STj As String<br> &nbsp; &nbsp;STlen = lstrlen(Str)<br> &nbsp; &nbsp;STj = Space(STlen)<br> &nbsp; &nbsp;LCMapString &H804, &H2000000, Str, STlen, STj, STlen<br> &nbsp; &nbsp;FToJ = STj<br>End Function
 
http://www.delphibbs.com/delphibbs/dispq.asp?lid=3049605
 
//简转繁<br>Function JToF(St:String):String;<br>var i,STlen:integer;<br> &nbsp; &nbsp;S,STf:String;<br>begin<br> &nbsp; &nbsp;STlen := length(Str);<br> &nbsp; &nbsp;S:='';<br> &nbsp; &nbsp;for i:=1 to STlen do<br> &nbsp; &nbsp; &nbsp;S := S+' ';<br> &nbsp; &nbsp;STf:=S;<br> &nbsp; &nbsp;LCMapString(&H804, &H4000000, Str, STlen, STf, STlen);<br> &nbsp; &nbsp;Result := STf;<br>End;<br>//繁转简<br>Function FToJ(Str:String):String;<br>var STlen:integer;<br> &nbsp; &nbsp;STj:String;<br>begin<br> &nbsp; &nbsp;STlen := length(Str);<br> &nbsp; &nbsp;S:='';<br> &nbsp; &nbsp;for i:=1 to STlen do<br> &nbsp; &nbsp; &nbsp;S := S+' ';<br> &nbsp; &nbsp;STj :=S;<br> &nbsp; &nbsp;LCMapString(&H804, &H2000000, Str, STlen, STj, STlen);<br> &nbsp; &nbsp;Result := STj;<br>End;
 
接受答案了.
 
后退
顶部