- ©«¤l
- 552
- ¥DÃD
- 3
- ºëµØ
- 0
- ¿n¤À
- 578
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2015-2-8
- ³Ì«áµn¿ý
- 2024-7-9
|
¥»©«³Ì«á¥Ñ lpk187 ©ó 2015-7-25 11:12 ½s¿è
¦^´_ 2# Min
"Ø"³oӲŸ¹VBA¬O¥i¥H¨ú±oªº- Sub VB_ASCII()
- Dim x As Integer
- Cells(1, 1) = "Item"
- Cells(1, 2) = "Chr"
- Cells(1, 3) = "Asc"
-
- For x = 0 To 255
- Cells(x + 2, 1) = x
- Cells(x + 2, 2) = ChrB(x)
- Cells(x + 2, 3) = AscB(ChrB(x))
- Next x
- End Sub
½Æ»s¥N½X VBA¤£¥uChr(n)¥i¥H¨Ï¥Î¡AÁÙ¦³ChrB(n)©MChrW(n)- Public Sub test()
- Dim n As String
- Dim arr(1 To 256, 1 To 512)
- n = 0
- For i = 1 To 256
- For j = 1 To 256
- arr(j, i * 2 - 1) = ChrW(n)
- arr(j, i * 2) = n
- n = n + 1
- Next
- Next
- Range("A1").Resize(256, 512) = arr
- End Sub
½Æ»s¥N½X Chr ¨ç¼Æ
½Ð°Ñ¾\ ½d¨Ò ¯S©Ê
¶Ç¦^¤@Ó§t¦³»P«ü©wªº¦r¤¸½X¬ÛÃö¤§¦r¤¸ªº String¡C
»yªk
Chr(charcode)
charcode ¤Þ¼Æ¬O¤@ӥΨÓÃѧO¬Y¦r¤¸ªºLong¡C
½Ðª`·N
0 ¨ì 31 ¤§¶¡ªº¼Æ¦r»P¤@¯ë¡B«D¦C¦LªºASCII½X¬Û¦P¡A¨Ò¦p¡AChr(10) ·|¶Ç¦^´«¦æ¦r¤¸¡Ccharcode ªº¥¿±`½d³ò¬° 0-255¡CµM¦Ó¡A¦bDBCS¨t²Î¡Acharcode ªº¹ê»Ú½d³ò¬° -32768 ¨ì 65535¡C
ªþµù ChrB ¨ç¼Æ¬O¨Ï¥Î©ó§t¦³¦ì¤¸²Õ¸ê®Æªº String¡A¦Ó«D¶Ç¦^¤@Ó¦r¤¸¡A¨ä¦³¥i¯à¬O¤@©Î¨âӦ줸²Õ¡A¦Ó ChrB ³£¬O¶Ç¦^¤@Ӧ줸²Õ¡CChrW ¨ç¼Æ«h¶Ç¦^¤@Ó¥]§tUnicode ¦r¤¸ªºString¡AY¦b¤£¤ä´©Unicodeªº¥¥x¤W¡A¨ä¥\¯à»PChr¨ç¼Æ¬Û¦P¡C
³Æµù Visual Basic for the Macintosh ¤£¤ä´© Unicode ¦r¦ê¡C©Ò¥H¡AChrW(n) µLªk¶Ç¦^ n Ó¼ÆÈ (½d³ò¬° 128 ¨ì 65,535) ªº©Ò¦³ Unicode ¦r¤¸¡A¦]¬°¥¦¦ì¦b Windows Àô¹Ò¤¤¡C¬Û¤Ï¦a¡AChrW(n) ·|¥ø¹Ï¬° n ¤j©ó 127 ªº Unicode ¼Æȶi¦æ¡u³Ì¨Î±À´ú¡v¡C¦]¦¹¡A±z¤£¥i¥H¦b Macintosh Àô¹Ò¤¤¨Ï¥Î ChrW¡C |
|