regina(1)

πŸ“¦
version 3.9.6 Β· 2 versions
, in debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– regina β€” The Regina Rexx Interpreter πŸ’–

okay bestie, sit down, grab a boba, because we're about to talk about regina, the Regina Rexx Interpreter, and honestly? she's iconic. no cap. 🫢


✨ SYNTAX ✨

regina [ options ] [ script [ scriptparams ]]

rexx [ options ] [ script [ scriptparams ]]

🌸 DESCRIPTION 🌸

so here's the vibe: regina will read the file named as script, and it's just gonna assume the contents of that file are a Rexx program, and then it interprets that program. that's the whole job. she reads, she interprets, she slays. πŸ’…

any parameters that come after script get interpreted as the parameters to the Rexx program. like, those are the program's args, not regina's. iykyk.

if script isn't specified, or it's specified as -, then the Rexx program to interpret gets read from standard input, and interpretation starts when the whole program has been read. so like, she waits for the whole thing before she goes. patient queen. πŸ‘‘

now, the regina executable supports the use of external function packages written to the SAA API, and loaded with the RxFuncAdd BIF. ✨

the rexx executable does not support the use of external function packages written to the SAA API, but it executes slightly faster than the regina executable. so it's giving "less features, more speed" energy. trade-offs, bestie, trade-offs. πŸ’€


πŸŽ€ OPTIONS πŸŽ€

  • -tx β€” sets tracing of the program to the option(s); "x" specified. any TRACE commands in the program will be ignored. so if you want to run your program with tracing set to "Intermediate", you can use the option -ti. if only -t is specified, "All" is the trace mode set. multiple tracing options can be specified. eg. to specify "intermediate", "interactive" tracing, specify -ti -t?.
  • -i β€” starts Regina in interactive mode. no script will be executed. just vibes, no script. πŸ™ˆ
  • -v β€” displays Regina version and exits. quick lil flex and then she's gone. πŸ’¨
  • -a β€” changes the way that arguments passed on the command line are made available to the called Rexx program. with this switch each parameter on the command line is available as a separate argument, rather then the normal behaviour of only making the combined command line arguments available as one internal argument. so like, everyone gets their own moment instead of being squished into one. main character energy for every arg. ⭐
  • -l[locale] β€” allows the user to specify the locale to be used. normally this switch is specified without the optional locale string, which uses the system's locale. 🌈
  • -p β€” relevant only on Win32 platforms. results in a Press ENTER key to exit... prompt to be displayed at the end of execution. this is useful when a Rexx program is run from Windows Explorer. a little "hey bestie, i'm done, press a key" moment. πŸ“
  • -r β€” runs a Rexx program in a restricted mode where any no changes to the external environment are allowed. writing to files, loading external function packages, and running external commands are prohibited. she's locked in. she's in her safe space. do not test her. 🚫
  • -ooptions β€” allows Regina OPTIONS to be passed to the Rexx program. the value of options is in the same format as the OPTIONS instruction. ✨
  • -c β€” compiles the specified script to a tokenised image and writes the image to an output file which is the the only other parameter allowed to be supplied. note: the original literally says "the the", and we respect the lore. πŸ‘‘
  • -e β€” executes the specified script as a tokenised image. all other switches above are allowed. the tokenised image is not allowed to be supplied via stdin. sorry bestie, stdin girlies, not this time. 😭

lowkey important reminder: that -ooptions one is doing a lot of heavy lifting, don't skip her. πŸ’œ

part 2 is coming, don't go anywhere. πŸ¦‹

✨ Built-ins ✨

Okay bestie, here's the whole list of all the standard built-in functions in Rexx. For a more complete description of each function, see the documentation accompanying Regina. Fr fr, this is the whole menu. 🫢

  • ABBREV(long,short[,length]) β€” Returns 1 or 0, depending on whether short is an abbreviation of long, or at least length characters. πŸ’…
  • ABS(number) β€” Returns the absolute value of number. ✨
  • ADDRESS() β€” Returns the name of the current environment. 🌸
  • ARG([argno[,option]]) β€” Without parameters, it returns the number of parameters. If only argno is specified, it must be a number, and that parameter is returned. Option can be E, N or O, and then either 0 or 1 is returned, depending on whether the numbered parameter existed or was omitted. The option N is the same as not specifying an option. πŸŽ€
  • B2X(binstring) β€” Converts the binary string binstring to a hex string. πŸ¦‹
  • BITAND(string1[,[string2][,padchar]]) β€” Returns a string which is the bitwise AND of its two first parameters. The shorter string is padded with padchar. πŸ’–
  • BITOR(string1[,[string2][,padchar]]) β€” Like BITAND but uses logical OR. πŸ”₯
  • BITXOR(string1[,[string2][,padchar]]) β€” Like BITAND but uses logical XOR. πŸ’€
  • C2D(string[,length]) β€” Converts the character string string to a decimal number. Length specifies the number of characters in string to convert. 🌈
  • C2X(string) β€” Converts the character string string to a hex string. ⭐
  • CENTER(string,length[,padchar]) β€” Centers string in a string of length characters, using padchar for padding, if necessary. πŸ‘‘
  • CENTRE(string,length[,padchar]) β€” Centers string in a string of length characters, using padchar for padding, if necessary. πŸ’œ
  • CHARIN([streamid][,[start][,length]]) β€” Read length (default is 1) characters from an input stream (default is the standard input stream), optionally starting at position start (default is the current read position). πŸ™ˆ
  • CHANGESTR(string1,string,string2) β€” Changes all occurrences of string1 in the string string to string2. πŸ“
  • CHAROUT([streamid][,[string][,start]]) β€” Writes stream to an output stream (default is the standard output stream), starting at position start (default is the current write position). 🧚
  • CHARS([streamid]) β€” Returns the number of characters left in the input stream (default is the standard input stream). πŸ’…
  • COMPARE(string1,string2[,padchar]) β€” Returns 0 or 1, depending on whether the two strings are equal. The shorter string is padded with padchar, or space if padchar is omitted. ✨
  • CONDITION([option]) β€” Performs various operations on streams, see other documentation. 🌸
  • COPIES(string,copies) β€” Returns copies copies of the string string. πŸŽ€
  • COUNTSTR(string1,string) β€” Returns the number of occurrences of string1 in the string string. πŸ¦‹
  • DATATYPE(string[,option]) β€” Returns the datatype of string: NUM if it is a number, LIT if it is as valid literal that does not have a variable value, VAR if it is a variable, and BAD otherwise. If option is specified, it must be one of these four, and then 0 or 1 is returned, depending on whether string is of the named type. πŸ’–
  • DATE([option-out,[date,[option-in]]]) β€” Returns the date, in various formats, which can be Base, Century, Days, European, Month, Normal, Ordered, Standard, USA, UnixTime, or Weekday. Can also be used to convert a date date from one format option-in to another; option-out. πŸ”₯
  • DELSTR(string,start[,length]) β€” Deletes the substring of string starting at position start and having a length of length (default is the rest of the string). πŸ’€
  • DELWORD(string,start[,length]) β€” Deletes length words (default is the rest of the string) from string, starting at word number start. 🌈
  • DIGITS() β€” Returns the current setting of NUMERIC DIGITS. ⭐
  • D2C(integer[,length]) β€” Converts the decimal number integer to a character string of length length. πŸ‘‘
  • D2X(integer[,length]) β€” Converts the decimal number integer to a hex string of length length. πŸ’œ
  • ERRORTEXT(errno) β€” Returns the error text associated with error number errno. errno can specify a sub-error number in the format n.n. eg. 40.1 πŸ™ˆ
  • FORM() β€” Returns the current setting of NUMERIC FORM. πŸ“
  • FORMAT(number[,[before][,[after][,[expp][,[expt]]]]]) β€” Formats number into a string having before digits before and after digits after the decimal point. The expp and expt governs how and when to use exponential form. 🧚
  • FUZZ() β€” Returns the current setting of NUMERIC FUZZ. πŸ’…
  • INSERT(string1,string2[,position[,length[,padchar]]]) β€” Inserts string1 into string2 at position position and with a length of length. ✨
  • LASTPOS(needle,haystack[,start]) β€” Seeks for needle in haystack, from the end towards the start. 🌸
  • LEFT(string,length[,padchar]) β€” Returns the length leftmost characters in string. πŸŽ€
  • LENGTH(string) β€” Returns the number of characters in string. πŸ¦‹
  • LINEIN([streamid][,[line][,count]]) β€” Reads a line from an input stream (default is the standard input stream), optionally starting at line. If count is zero, no reading is performed (only repositioning). πŸ’–
  • LINEOUT([streamid][,[string][,line]]) β€” Writes the line string to an output stream (default is the standard output stream, optionally starting at line. πŸ”₯
  • LINES([streamid]) β€” Returns the number of complete lines left in an input stream. πŸ’€
  • MAX(number1[,number2]...) β€” Returns the maximum of its parameters. 🌈
  • MIN(number[,number]...) β€” Returns the minimum of its parameters. ⭐
  • OVERLAY(string1,string2[,[start][,[length][,padchar]]]) β€” Overwrites string2 with contents of string1. πŸ‘‘
  • POS(needle,haystack[,start]) β€” Seeks for first occurrence of needle in haystack. πŸ’œ
  • QUEUED() β€” Returns the number of lines in the external data queue (stack). πŸ™ˆ
  • RANDOM(max) β€” Returns a random number in the range min to max (default is 0 and 100000). πŸ“
  • RANDOM([min][,[max][,seed]]) β€” Returns a random number in the range min to max (default is 0 and 100000). 🧚
  • REVERSE(string) β€” Reverses the order of the characters in string. πŸ’…
  • RIGHT(string,length[,padchar]) β€” Returns the length rightmost characters in string. ✨
  • rxfuncadd(external,library,internal) β€” Loads an external function called; internal residing in the library shared library. external is the name of the function as known to the interpreter. 🌸
  • SIGN(number) β€” Returns -1, 0, or 1, depending on the sign of number. πŸŽ€
  • SOURCELINE([lineno]) β€” Returns the number of lines in the source for the current script, or the line specified by lineno. πŸ¦‹
  • SPACE(string[,[length][,padchar]]) β€” Transform any sequence of spaces in string into exactly length spaces, and strips off leading and trailing spaces. πŸ’–
  • STREAM(streamid[,option[,command]]) β€” Returns information about a stream, valid options are Command, Description, and State. See other documentation for more information. πŸ”₯
  • STRIP(string[,[option][,char]]) β€” Strips leading and trailing chars off string. Option can be Leading, Trailing, or Both. πŸ’€
  • SUBSTR(string,start[,[length][,padchar]]) β€” Returns the substring of string starting at start and having length length. 🌈
  • SUBWORD(string,start[,length]) β€” Returns a subsequence of length words from string starting at start. ⭐
  • SYMBOL(name) β€” Test whether name is a numbol, variable, literal. πŸ‘‘
  • TIME([option-out,[time,[option-in]]]) β€” Returns the time, options are Civil, Elapsed, Hours, Long, Minutes, Normal, Reset, and Seconds. Can also be used to convert a time time from one format option-in to another; option-out. πŸ’œ
  • TRACE([setting]) β€” Returns the current trace setting, and optionally sets a new one. πŸ™ˆ
  • TRANSLATE(string[,[tableout][,[tablein][,padchar]]]) β€” Translates characters in string from tablein to tableout. πŸ“
  • TRUNC(number[,length]) β€” Truncates number to length decimals. 🧚
  • VALUE(symbol[,[value],[pool]]) β€” Returns the value of symbol, optionally setting it to value afterwards. πŸ’…
  • VERIFY(string,ref[,[option][,start]]) β€” Verifies that strings consists of characters from ref, and returns the first character that does not match. Option can be Match or Nomatch. ✨
  • WORD(string,wordno) β€” Returns word number wordno in string. 🌸
  • WORDINDEX(string,wordno) β€” Returns the character position of word nun. πŸŽ€
  • WORDLENGTH(string,wordno) β€” Returns the length of word number wordno in string. πŸ¦‹
  • WORDPOS(phrase,string[,start]) β€” Returns the word position of the start of phrase in string. πŸ’–
  • WORDS(string) β€” Returns the number of words in string. πŸ”₯
  • XRANGE([start][,end]) β€” Returns in alphabetic order all the characters in the character set from the character start to the character end. πŸ’€
  • X2B(hexstring) β€” Converts the hex string hexstring to a binary string. 🌈
  • X2C(hexstring) β€” Converts the hex string hexstring to a character string. ⭐
  • X2D(hexstring[,length]) β€” Converts the length rightmost characters of the hex string hexstring to a decimal number. πŸ‘‘

The Regina Rexx interpreter is distributed under the GNU Library General Public License, see the file COPYING-LIB in the source code distribution. Periodt. πŸ’…

✍️ Author ✍️

Anders Christensen, University of Trondheim, Norway <anders@pvv.unit.no>. 🫢

πŸ› οΈ Maintainer πŸ› οΈ

Changes to Regina since 0.07a, Mark Hessling <mark (at) rexx.org> with significant assistance from Florian Grosse-Coosmann. πŸ‘‘

πŸ” See Also πŸ”

There are several good reference books on Rexx. The most famous is "The Rexx Language" by Mike Cowlishaw. Visit https://www.rexxla.org (The Rexx Language Association) for any Rexx related information. 🌈


And that's the whole regina(1) manual page, bestie β€” source/version and date are chillin' in the footer, iykyk πŸ’–βœ¨

πŸ“¦ where this page comes from