September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -0,0 +1,34 @@
* Character codes EBCDIC 15/02/2017
CHARCODE CSECT
USING CHARCODE,R13 base register
B 72(R15) skip savearea
DC 17F'0' savearea
STM R14,R12,12(R13) prolog
ST R13,4(R15) " <-
ST R15,8(R13) " ->
LR R13,R15 " addressability
* Character to Decimal
SR R1,R1 r1=0
IC R1,=C'a' insert character 'a'
XDECO R1,PG
XPRNT PG,L'PG print -> 129
* Hexadecimal to character
SR R1,R1 r1=0
IC R1,=X'81' insert character X'81'
STC R1,CHAR store character r1
XPRNT CHAR,L'CHAR print -> 'a'
* Decimal to character
LH R1,=H'129' r1=129
STC R1,CHAR store character r1
XPRNT CHAR,L'CHAR print -> 'a'
*
XDUMP CHAR,L'CHAR dump -> X'81'
*
RETURN L R13,4(0,R13) epilog
LM R14,R12,12(R13) " restore
XR R15,R15 " rc=0
BR R14 exit
PG DS CL12
CHAR DS CL1
YREGS
END CHARCODE

View file

@ -0,0 +1,7 @@
' ASCII
c$ = "$"
PRINT c$, ": ", ASC(c$)
' UTF-8
uc$ = "€"
PRINT uc$, ": ", UCS(uc$), ", ", UCS(c$)

View file

@ -0,0 +1,33 @@
@echo off
:: Supports all ASCII characters and codes from 34-126 with the exceptions of:
:: 38 &
:: 60 <
:: 62 >
:: 94 ^
:: 124 |
:_main
call:_toCode a
call:_toChar 97
pause>nul
exit /b
:_toCode
setlocal enabledelayedexpansion
set codecount=32
for /l %%i in (33,1,126) do (
set /a codecount+=1
cmd /c exit %%i
if %1==!=exitcodeAscii! (
echo !codecount!
exit /b
)
)
:_toChar
setlocal
cmd /c exit %1
echo %=exitcodeAscii%
exit /b

View file

@ -1,9 +1,9 @@
#define system.
import extensions.
#symbol program =>
program =
[
#var ch := #97.
var ch := $97.
console writeLine:ch.
console writeLine:(ch int).
console writeLine(ch toInt).
].

View file

@ -0,0 +1,10 @@
Public Sub Form_Open()
Dim sChar As String
sChar = InputBox("Enter a character")
Print "Character " & sChar & " = ASCII " & Str(Asc(sChar))
sChar = InputBox("Enter a ASCII code")
Print "ASCII code " & sChar & " represents " & Chr(Val(sChar))
End

View file

@ -0,0 +1,8 @@
fun main(args: Array<String>) {
var c = 'a'
var i = c.toInt()
println("$c <-> $i")
i += 2
c = i.toChar()
println("$i <-> $c")
}

View file

@ -7,5 +7,5 @@ fn main() {
//unicode char
println!("{}", 'π' as u32);
println!("{}", from_u32(960).unwrap();
println!("{}", from_u32(960).unwrap());
}

View file

@ -0,0 +1,4 @@
x = #.array("a")
#.output("a -> ",x[1]," ",x[2])
x = [98,0]
#.output("98 0 -> ",#.str(x))

View file

@ -0,0 +1,2 @@
"a".toAsc() //-->97
(97).toChar() //-->"a"