diff --git a/docs/oodguide.pdf b/docs/oodguide.pdf new file mode 100644 index 0000000..9d9be66 Binary files /dev/null and b/docs/oodguide.pdf differ diff --git a/docs/oodialog.pdf b/docs/oodialog.pdf new file mode 100644 index 0000000..58360f3 Binary files /dev/null and b/docs/oodialog.pdf differ diff --git a/docs/oorexxbuild.pdf b/docs/oorexxbuild.pdf new file mode 100644 index 0000000..5bb6cc2 Binary files /dev/null and b/docs/oorexxbuild.pdf differ diff --git a/docs/oosqlite.pdf b/docs/oosqlite.pdf new file mode 100644 index 0000000..a3aa113 Binary files /dev/null and b/docs/oosqlite.pdf differ diff --git a/docs/orxncurses.pdf b/docs/orxncurses.pdf new file mode 100644 index 0000000..4eaab5f Binary files /dev/null and b/docs/orxncurses.pdf differ diff --git a/docs/rexxapi.pdf b/docs/rexxapi.pdf new file mode 100644 index 0000000..21b022e Binary files /dev/null and b/docs/rexxapi.pdf differ diff --git a/docs/rexxextensions.pdf b/docs/rexxextensions.pdf new file mode 100644 index 0000000..54be3a9 Binary files /dev/null and b/docs/rexxextensions.pdf differ diff --git a/docs/rexxpg.pdf b/docs/rexxpg.pdf new file mode 100644 index 0000000..0e6c4ed Binary files /dev/null and b/docs/rexxpg.pdf differ diff --git a/docs/rexxref.pdf b/docs/rexxref.pdf new file mode 100644 index 0000000..6e59e8d Binary files /dev/null and b/docs/rexxref.pdf differ diff --git a/docs/rxftp.pdf b/docs/rxftp.pdf new file mode 100644 index 0000000..61a7c76 Binary files /dev/null and b/docs/rxftp.pdf differ diff --git a/docs/rxmath.pdf b/docs/rxmath.pdf new file mode 100644 index 0000000..b438719 Binary files /dev/null and b/docs/rxmath.pdf differ diff --git a/docs/rxsock.pdf b/docs/rxsock.pdf new file mode 100644 index 0000000..6ead8f7 Binary files /dev/null and b/docs/rxsock.pdf differ diff --git a/docs/unixextensions.pdf b/docs/unixextensions.pdf new file mode 100644 index 0000000..87aa590 Binary files /dev/null and b/docs/unixextensions.pdf differ diff --git a/projects/oorexx/1plus1.rex b/projects/oorexx/1plus1.rex deleted file mode 100644 index 345f008..0000000 --- a/projects/oorexx/1plus1.rex +++ /dev/null @@ -1,2 +0,0 @@ -Say '1'+'1' -Say "2" * 2 diff --git a/projects/oorexx/address-test.rex b/projects/oorexx/address-test.rex old mode 100644 new mode 100755 index 56ce945..85cbe59 --- a/projects/oorexx/address-test.rex +++ b/projects/oorexx/address-test.rex @@ -1,7 +1,67 @@ +#!/usr/bin/env rexx + /* Rexx */ +Address system "pwd" with output stem pwd. +.environment~pwd = pwd.1 -Address "zsh" "ls -lA" With output stem dir. - +Address system "ls -lAh "||.environment~pwd With output stem dir. +dirlist1 = .array~new() Do i = 1 to dir.0 - say dir.i + if dir.i~StartsWith("total") then nop + Else call add_to_array1(dir.i) +End +dirjson1 = .json~new()~toJSON(dirlist1) + +say dirjson1~e + +Say " " +call SysFileTree .environment~pwd||"/", file., 'BL' +dirlist2 = .array~new() +do i = 1 to file.0 + call add_to_array2(file.i) end +dirjson2 = .json~new()~toJSON(dirlist2) +Say dirjson2 + +Exit + +add_to_array1: PROCEDURE expose dirlist1 + parse arg attrs filecnt . . filesz . . . filenm + dirlist1~append(.directory~new()) + + dirlist1[dirlist1~last]['name'] = filenm + + if attrs~startsWith("d") then dirlist1[dirlist1~last]['type'] = 'dir' + else dirlist1[dirlist1~last]['type'] = 'file' + + if attrs~startsWith("d") then NOP + else dirlist1[dirlist1~last]['bytes'] = filesz +Return dirlist1 + +add_to_array2: PROCEDURE expose dirlist2 + /* 3/16/25 2:29p 558 -rwxrwxr-x /home/gmgauthier/Projects/rexx-things/projects/oorexx/params.rex */ + parse arg . . filesz attrs filepath + + filenm = parse_filename(filepath) + + dirlist2~append(.directory~new()) + dirlist2[dirlist2~last]['name'] = filenm + + if attrs~startsWith("d") then dirlist2[dirlist2~last]['type'] = 'dir' + else dirlist2[dirlist2~last]['type'] = 'file' + + if attrs~startsWith("d") then NOP + else dirlist2[dirlist2~last]['bytes'] = filesz +Return dirlist2 + +parse_filename: procedure + parse arg filepath + + /* Parse the filepath to get just the filename */ + parse var filepath . '/' filename + do while pos('/', filename) > 0 + parse var filename . '/' filename + end +return filename + +::requires 'json.cls' diff --git a/projects/oorexx/csv-file-test.rex b/projects/oorexx/csv-file-test.rex new file mode 100755 index 0000000..93b5ef4 --- /dev/null +++ b/projects/oorexx/csv-file-test.rex @@ -0,0 +1,39 @@ +#!/usr/bin/env rexx +/* Rexx */ + +csv = .csvStream~new('headered.csv', .true) +csv~open + +/* Stream class defaults to both ie:readWrite */ +myTable = .table~new +myTable~put('red','colour') +myTable~put('stop','action') + +csv~CSVLineout(myTable) +myTable~put('green','colour') +myTable~put('go','action') + +csv~CSVLineout(mytable) +myTable~put('yellow', 'colour') +myTable~put('decelerate', 'action') + +csv~CSVLineout(myTable) +csv~close + +/* Read it back */ +Csv~open('read') +Do while csv~chars > 0 + Csv~csvLineIn + Say 'new record' + Do field over csv~values + Say field':' csv~values~at(field) /* colour: green */ + End +End +/*======================*/ +csv~close + +Exit + +::requires 'csvStream.cls' + + diff --git a/projects/oorexx/functions.rex b/projects/oorexx/functions.rex new file mode 100644 index 0000000..beb076f --- /dev/null +++ b/projects/oorexx/functions.rex @@ -0,0 +1,4 @@ +tabs: + parse arg count + tab = X2C("09") +return copies(tab, count) diff --git a/projects/oorexx/headered.csv b/projects/oorexx/headered.csv new file mode 100644 index 0000000..c4c1bf2 --- /dev/null +++ b/projects/oorexx/headered.csv @@ -0,0 +1,4 @@ +"colour","action" +"red","stop" +"green","go" +"yellow","decelerate" diff --git a/projects/oorexx/hello.rex b/projects/oorexx/hello.rex index 98a4841..777cf2d 100644 --- a/projects/oorexx/hello.rex +++ b/projects/oorexx/hello.rex @@ -3,6 +3,10 @@ call RxFuncAdd 'SysGetPid', 'rxunixsys', 'SysGetPid' call RxFuncAdd 'SysGethostname', 'rxunixsys', 'SysGethostname' call RxFuncAdd 'SysUname', 'rxunixsys', 'SysUname' */ + +Address system "pwd" with output stem pwd. +say pwd.1 + If RxFuncQuery("SockDropFuncs") then Do rc = RxFuncAdd("SockLoadFuncs","rxsock","SockLoadFuncs") diff --git a/projects/oorexx/jabberwocky.txt b/projects/oorexx/jabberwocky.txt new file mode 100644 index 0000000..fd03221 --- /dev/null +++ b/projects/oorexx/jabberwocky.txt @@ -0,0 +1,38 @@ +Jabberwocky + +'Twas brillig, and the slithy toves +Did gyre and gimble in the wabe: +All mimsy were the borogoves, +And the mome raths outgrabe. + +'Beware the Jabberwock, my son! +The jaws that bite, the claws that catch! +Beware the Jubjub bird, and shun +The frumious Bandersnatch!' + +He took his vorpal sword in hand: +Long time the manxome foe he sought -- +So rested he by the Tumtum tree, +And stood a while in thought. + +And, as in uffish thought he stood, +The Jabberwock, with eyes of flame, +Came whiffling through the tulgey wood, +And burbled as it came! + +One two! One two! And through and through +The vorpal blade went snicker-snack! +He left it dead, and with its head +He went galumphing back. + +'And hast thou slain the Jabberwock? +Come to my arms, my beamish boy! +Oh frabjous day! Callooh! Callay!' +He chortled in his joy. + +'Twas brillig, and the slithy toves +Did gyre and gimble in the wabe: +All mimsy were the borogoves, +And the mome raths outgrabe. + +Lewis Carroll diff --git a/projects/oorexx/one-plus1.rex b/projects/oorexx/one-plus1.rex new file mode 100644 index 0000000..44a2815 --- /dev/null +++ b/projects/oorexx/one-plus1.rex @@ -0,0 +1,5 @@ +/* Rexx */ + +Say '1'+ "1" + 1 + d2c(49) + +Say "8.4" / (3.1 - '2') * (D2C(57) + D2C(53)) \ No newline at end of file diff --git a/projects/oorexx/params.rex b/projects/oorexx/params.rex index 5ff039a..7d280c4 100755 --- a/projects/oorexx/params.rex +++ b/projects/oorexx/params.rex @@ -1,9 +1,14 @@ #!/usr/bin/env rexx + /* Rexx */ Address system parse arg parms +Address system "pwd" with output stem pwd. +say pwd.1 + + call parse_argv say "Instruction: " || instr @@ -17,7 +22,7 @@ parse_argv: procedure expose parms instr parm return HELP: - "clear" + /* "clear" */ say "********************************************************" say "* YOUR STRINGS WERE EMPTY. HOW DARE YOU. *" say "********************************************************" diff --git a/projects/oorexx/regex-test.rex b/projects/oorexx/regex-test.rex new file mode 100644 index 0000000..4980be9 --- /dev/null +++ b/projects/oorexx/regex-test.rex @@ -0,0 +1,10 @@ +str = "
Paragraph 1
Paragraph 2
" +re1 = .RegularExpression~new("?*
", "MINIMAL") +re1~match(str) +re2 = .RegularExpression~new("?*
", "MAXIMAL") +re2~match(str) +say "re1 (minimal) matched" str~substr(1, re1~position) +say "re2 (maximal) matched" str~substr(1, re2~position) +EXIT + +::requires "rxregexp.cls" \ No newline at end of file diff --git a/projects/oorexx/sayos.rex b/projects/oorexx/sayos.rex new file mode 100755 index 0000000..cd61d08 --- /dev/null +++ b/projects/oorexx/sayos.rex @@ -0,0 +1,5 @@ +#!/usr/bin/env rexx + +parse source os + +say os diff --git a/projects/oorexx/text-attrs.rex b/projects/oorexx/text-attrs.rex index 16e86bc..456a171 100755 --- a/projects/oorexx/text-attrs.rex +++ b/projects/oorexx/text-attrs.rex @@ -1,11 +1,9 @@ #!/usr/bin/env rexx -::requires "ncurses.cls" - lf = .window~ASCII_LF~d2c() bs = .window~ASCII_BS~d2c() -text = .array~of('Do', 'you', 'find', 'this', 'silly?') +text = .array~of('One', 'Two', 'Three', 'Four', 'Five') scr = .window~new() do a = 1 to text~items() @@ -24,3 +22,6 @@ scr~endwin Exit +::requires "ncurses.cls" + + diff --git a/projects/oorexx/tso-emu.rex b/projects/oorexx/tso-emu.rex new file mode 100755 index 0000000..d68a7fb --- /dev/null +++ b/projects/oorexx/tso-emu.rex @@ -0,0 +1,11 @@ +#!/usr/bin/env rexx + +address hostemu 'execio * diskr "jabberwocky.txt" (finis stem jby.' + +Do x = 1 to jby.0 + Say jby.x +End + +Exit + +::requires "hostemu" LIBRARY \ No newline at end of file diff --git a/projects/oorexx/wx.rex b/projects/oorexx/wx.rex index e0a8bd4..ce8a85c 100755 --- a/projects/oorexx/wx.rex +++ b/projects/oorexx/wx.rex @@ -1,4 +1,4 @@ #!/usr/bin/env rexx -parse arg loc -if loc = "" then loc="Cowley,UK" +Parse Arg loc +If loc = "" Then loc="Cowley,UK" Address system "ansiweather -l "||loc||" -u imperial -s true -i false -a true"