home *** CD-ROM | disk | FTP | other *** search
-
- ; This file shows many of the abilities of RONSET in batch mode.
- ; It is not meant to be complete, or even very useful...
- ; Type RONSET batch(examples.ron) to execute it.
-
- ; Make an "up" sound
- sound(200,440,880,1760,3520)
-
- ; Clear the screen
- echo(chr(27)[H chr(27)[2J)
-
- echo() echo( RONSET SAMPLE PROGRAM)
- echo( ------ ------ -------)
-
- echo()
- echo(In response to the next two questions, you may type "124" for the )
- echo("Net:" question, and "1113" for the "Node:" question. This is the )
- echo(example from the documentation. The result should be 007c0459.REQ )
- echo()
- fname=low(concat(hex(string(Net:,5)),hex(string(Node:,5))).REQ)
- echo(The result is "trans(fname)".)
- fname=
-
- echo() char(Press any key to continue,,30) echo(chr(27)[H chr(27)[2J) echo()
-
- echo(Arithmetic) echo(----------)
- x1=string( Enter first number:,5)
- x2=string(Enter second number:,5)
- =echo(trans(x1) + trans(x2) = add(trans(x1),trans(x2)))
- =echo(trans(x1) - trans(x2) = sub(trans(x1),trans(x2)))
- =echo(trans(x1) * trans(x2) = mult(trans(x1),trans(x2)))
- =echo(trans(x1) / trans(x2) = div(trans(x1),trans(x2)))
- =echo(trans(x1) % trans(x2) = mod(trans(x1),trans(x2)))
- =echo(if(eq(trans(x1),trans(x2)),trans(x1) = trans(x2)))
- echo(if(ne(trans(x1),trans(x2)),trans(x1) <> trans(x2)))
- echo(if(lt(trans(x1),trans(x2)),trans(x1) < trans(x2)))
- =echo(if(le(trans(x1),trans(x2)),trans(x1) <= trans(x2)))
- echo(if(gt(trans(x1),trans(x2)),trans(x1) > trans(x2)))
- =echo(if(ge(trans(x1),trans(x2)),trans(x1) >= trans(x2)))
- echo(Absolute values are abs(trans(x1)) and abs(trans(x2)))
- echo(Negative values are neg(trans(x1)) and neg(trans(x2)))
- echo(Squared values are sqr(trans(x1)) and sqr(trans(x2)))
- echo(Square roots are sqrt(abs(trans(x1))) and sqrt(abs(trans(x2))))
- echo('trans(x1)' is if(num(trans(x1)),,not )completely digits)
- echo('trans(x2)' is if(num(trans(x2)),,not )completely digits)
- echo('trans(x1)' is if(number(trans(x1)),,not )completely numeric)
- echo('trans(x2)' is if(number(trans(x2)),,not )completely numeric)
-
- echo() char(Press any key to continue,,30) echo(chr(27)[H chr(27)[2J) echo()
-
- echo(Binary Arithmetic) echo(------ ----------) echo()
- echo(function binary octal hex decimal)
- echo(-------- ---------------- ------ ---- -------)
- echo( 1st bin(trans(x1)) oct(trans(x1)) hex(trans(x1)) trans(x1))
- echo( 2nd bin(trans(x2)) oct(trans(x2)) hex(trans(x2)) trans(x2))
- echo(-------- ---------------- ------ ---- -------)
- x3=and(trans(x1),trans(x2))
- echo( AND bin(trans(x3)) oct(trans(x3)) hex(trans(x3)) trans(x3))
- x3=or(trans(x1),trans(x2))
- echo( OR bin(trans(x3)) oct(trans(x3)) hex(trans(x3)) trans(x3))
- x3=xor(trans(x1),trans(x2))
- echo( XOR bin(trans(x3)) oct(trans(x3)) hex(trans(x3)) trans(x3))
- x3=not(trans(x1))
- echo(NOT 1st bin(trans(x3)) oct(trans(x3)) hex(trans(x3)) trans(x3))
- x3=not(trans(x2))
- echo(NOT 2nd bin(trans(x3)) oct(trans(x3)) hex(trans(x3)) trans(x3))
- x1=
- x2=
- x3=
-
- echo() char(Press any key to continue,,30) echo(chr(27)[H chr(27)[2J) echo()
-
- echo(String Functions) echo(------ ---------) echo()
- ---------------------
- fn=string(What is your FIRST name?,15)
- x=len(trans(fn))
- ;if nothing entered, change it to my name
- fn=if(eq(trans(x),0),rON,trans(fn))
- x=sub(len(trans(fn)),1)
- ;fix up capitalization
- fn=concat(up(left(1,trans(fn))),low(right(trans(x),trans(fn))))
- ;---------------------
- mn=string(What is your MIDDLE name?,10)
- x=len(trans(mn))
- ;if nothing entered, change it to my name
- mn=if(eq(trans(x),0),aLAN,trans(mn))
- x=sub(len(trans(mn)),1)
- ;fix up capitalization
- mn=concat(up(left(1,trans(mn))),low(right(trans(x),trans(mn))))
- ;---------------------
- ln=string(What is your LAST name?,15)
- x=len(trans(ln))
- ;if nothing entered, change it to my name
- ln=if(eq(trans(x),0),bEMIS,trans(ln))
- x=sub(len(trans(ln)),1)
- ;fix up capitalization
- ln=concat(up(left(1,trans(ln))),low(right(trans(x),trans(ln))))
- ;---------------------
- mi=mid(1,1,trans(mn))
- echo()
- echo(Middle initial is trans(mi), which is ASCII character asc(trans(mi)))
- echo(trans(fn) trans(mn) trans(ln))
- echo(trans(fn) trans(mi). trans(ln))
- echo(trans(fn) trans(ln))
- echo(left(1,trans(fn)). left(1,trans(mn)). left(1,trans(ln)).)
- echo(concat(left(1,trans(fn)),left(1,trans(mn)),left(1,trans(ln))))
- fl=trans(fn) trans(mn) trans(ln)
- echo(up(trans(fl)))
- echo(low(trans(fl)))
- mn=
- mi=
- x=
-
- echo() char(Press any key to continue,,30) echo(chr(27)[H chr(27)[2J) echo()
-
- echo(String Search/Replace) echo(------ --------------) echo()
- echo(trans(fl))
- echo()
- x=char(Press a letter that's in your name:,trans(fl))
- y=pos(trans(x),trans(fl))
- echo(That letter first appears in position trans(y) of your name)
- echo(Here's your name with 'trans(x)' changed to '*':)
- echo(replace(trans(x),*,trans(fl)))
- fl=
- x=
- y=
-
- echo() char(Press any key to continue,,30) echo(chr(27)[H chr(27)[2J) echo()
-
- echo(String Comparisons) echo(------ -----------) echo()
- =echo(if(eqs(trans(fn),trans(ln)),trans(fn) = trans(ln)))
- echo(if(nes(trans(fn),trans(ln)),trans(fn) <> trans(ln)))
- echo(if(lts(trans(fn),trans(ln)),trans(fn) < trans(ln)))
- =echo(if(les(trans(fn),trans(ln)),trans(fn) <= trans(ln)))
- echo(if(gts(trans(fn),trans(ln)),trans(fn) > trans(ln)))
- =echo(if(ges(trans(fn),trans(ln)),trans(fn) >= trans(ln)))
- echo('trans(fn)' is if(alpha(trans(fn)),,not )completely alphabetic)
- fn=
- ln=
-
- echo() char(Press any key to continue,,30) echo(chr(27)[H chr(27)[2J) echo()
-
- echo(Files) echo(-----) echo()
- file=string(Type a filename:,50)
- echo(Base filename with extension is file(trans(file)))
- echo(Base filename is name(trans(file)))
- echo(Extension is ext(trans(file)))
- echo(Disk drive is drive(trans(file)))
- echo(Directory path is path(trans(file)))
- echo(Full filespec is full(trans(file)))
- echo(Drive and directory is dir(trans(file)))
- echo(There are matches(trans(file)) files that match this filename)
- echo(This filename if(wild(trans(file)),contains,does not contain) wildcards)
- echo(The first match is expand(trans(file)))
- file=expand(trans(file))
-
- echo() char(Press any key to continue,,30) echo(chr(27)[H chr(27)[2J) echo()
-
- echo(trans(file)) echo()
- echo(This file if(exist(trans(file)),exists,does not exist))
- echo(Size of 'trans(file)' is size(trans(file)))
- echo(Date of 'trans(file)' is fdate(trans(file)))
- echo(This file contains lines(trans(file)) lines)
- echo(This is the first line of the file:)
- echo('read(trans(file),1)')
- echo()
- x=attr(trans(file))
- echo(This file's attributes are bin(trans(x)))
- echo( if(eq(or(1,trans(x)),1),Read-only,Read/Write))
- echo( if(eq(or(2,trans(x)),2),Hidden,Non-Hidden))
- echo( if(eq(or(4,trans(x)),4),System,Non-System))
- echo( if(eq(or(16,trans(x)),16),Directory,Non-Directory))
- echo( if(eq(or(32,trans(x)),32),Archive,Non-Archive))
- echo(The default disk's label is 'label()')
- x=
-
- echo() char(Press any key to continue,,30) echo(chr(27)[H chr(27)[2J) echo()
-
- echo(Peeking into Files) echo(------- ---- -----) echo()
- echo(trans(file)) echo()
- echo(byte at offset 20 is byte(20,trans(file)))
- echo(word at offset 20 is word(20,trans(file)))
- echo(long at offset 20 is long(20,trans(file)))
- echo(line at offset 20 is:)
- echo(line(20,trans(file)))
- file=
-
- echo() char(Press any key to continue,,30) echo(chr(27)[H chr(27)[2J) echo()
-
- echo(DOS directory:)
- exec(trans(COMSPEC) /C DIR /W)
-
- echo() char(Press any key to continue,,30) echo(chr(27)[H chr(27)[2J) echo()
-
- echo(Miscellaneous) echo(-------------) echo()
- x=free()
- y=total()
- z=used()
- echo(Disk space on this drive: trans(y))
- echo(Free space on this drive: trans(x) [div(mult(100,trans(x)),trans(y))%])
- echo(Used space on this drive: trans(z) [div(mult(100,trans(z)),trans(y))%])
- echo()
- x=env()
- y=tenv()
- z=sub(trans(y),trans(x))
- echo(Environment space: trans(y))
- echo(Free environment space: trans(x) [div(mult(100,trans(x)),trans(y))%])
- echo(Used environment space: trans(z) [div(mult(100,trans(z)),trans(y))%])
- echo()
- echo(DOS version ver(both) - major version ver(major) and minor version ver(minor))
- x=
- y=
- z=
-
- ;Show program info
- info()
-
- delay(5)
-
- ; Make a "down" sound
- sound(200,3520,1760,880,440)
-