目前分類:未分類文章 (2)
- May 30 Tue 2017 18:12
雙敗淘汰圖形產生器
- Sep 19 Mon 2016 11:08
LibreOffice 巨集-自訂函數:HEX2UNICHAR
將以下代碼貼到Basic IDE即可使用
Function HEX2UNICHAR(Hex as String) as String
Dim uc&,i&,L&,str$,t&
L=Len(Hex)
if L>6 then
L=6
end if
For i=1 To L
t=asc(Mid(Hex,i,1))
if 48<=t and t<=57 then
t=t-48
elseif 65<=t and t<=70 then
t=t-65+10
elseif 97<=t and t<=102 then
t=t-97+10
else
Exit For
end if
uc=(uc*16)+t
Next i
if uc < &h10000 then
str=Chr(uc)
else
uc=uc - &h10000
str=Chr(uc \ &h400 + &hD800) & Chr(uc Mod &h400 + &hDC00)
end if
HEX2UNICHAR=str
End Function