OSDN Git Service

こっそり、気持ち程度の日本語化しました (UTF-8 / Windows 環境用)。
[ring-lang-081/annotated-ring-with-OmegaT.git] / target / ringlibs / stdlib / stdconversion.ring
1 # Ring 標準ライブラリ
2 # アプリケーション用の汎用関数とクラス
3 # 2016, Mahmoud Fayed <msfclipper@yahoo.com>
4
5 Load "stdfunctions.ring"
6 Load "stdbase.ring"
7 Load "stdlibcore.ring"
8
9 if IsMainSourceFile() 
10         conversion_class_test()
11 ok
12
13 func conversion_class_test
14         
15         oConversion = new conversion
16         See "Test the conversion Class Methods" + nl
17         See oConversion.number("3") + 5  + nl
18         See oConversion.string(3) + "5" + nl
19         See oConversion.Ascii("m") + nl 
20         See oConversion.char(77) + nl   
21         see oConversion.hex(162) + nl
22         see oConversion.dec("a2") + nl
23         cHex = oConversion.str2hex("Hello")
24         see cHex + nl
25         see oConversion.hex2str(cHex) + nl
26
27 Class conversion
28  
29         Func number vValue
30                 return std_number(vValue)
31
32         Func string vValue
33                 return std_string(vValue)
34
35         Func ascii vValue
36                 return std_ascii(vValue)
37
38         Func char vValue
39                 return std_char(vValue)
40
41         Func hex vValue
42                 return std_hex(vValue)
43
44         Func dec vValue
45                 return std_dec(vValue)
46
47         Func str2hex vValue
48                 return std_str2hex(vValue)
49
50         Func hex2str vValue
51                 return std_hex2str(vValue)