Released version :
------------------
19.18.01
New features.
-------------
LINESZ is now 1024 bytes.
Strings can be up to 67108864 bytes.
Function keys are now 1 to 64. (Before it was 1 to 40).
Discussion
----------
While this may look like a minor update, under the covers, this is probably the
biggest update ever to Open/ed.
In the past, Open/ed has worked with fixed length strings of size LINESZ. Now it
works with dynamic or "growing" strings (gst) and almost every line of code dealing
with a string has been changed to use a gstlib library function.
At this stage each line of text still has a _maximum_ line size %LINESZ% also
reported by the LINESZ command. This is now at 1024 bytes. Text in the work file
that is longer than this is still flagged as a "split" line when read in and
discarded if made during editing. Any other string can be up to %STR_MAX% 67108864 bytes.
Each line of text and each string only uses the memory required. So an empty
line or string is 0 bytes of text plus some overheads.
This has caused a philosophical change. Blank areas on the screen after text on
each line now may or may not be spaces. In the past every blank column of text that
could be seen up to LINESZ by scrolling to the right, was a space. Now it
may be a trailing space or it may be empty. An empty line is visually blanks but
you can no longer LOCATE or FIND spaces there.
To make this more predictable we have added MODE TRIM which discards trailing
spaces. With this mode enabled, any text file that is read in to or written by
Open/ed will have trailing spaces trimmed from the line. This mode is off by
default so to enable it when your work file is read in to Open/ed, use the
program argument -trim on/enabled/1. You can also add it to your begin.ned
macro as "mode trim".
Program options
---------------
ned -print now Prints the epoch time in seconds and exits. Same as NOW().
ned -trim on,off Sets Mode TRIM for discarding trailing spaces in file I/O.
Commands
--------
New
---
The NICE command slows the execution of Open/ed.
After many years, the SWAP command has been implimented.
Changes
-------
The DATE and TIME commands may now take an argument to format their output.
The STAR command '*' can not be in a macro.
The BLOCK command without any arguments, if executed in a block, will unblock.
The ALIGN command will no longer erase text when left shifting.
FUN EXEC overhauled.
- Works with F keys up to 64.
- Accepts 'from' and 'to' arguments.
- Accepts 'to' and 'from' in reverse order to display in reverse order.
- Does not list unused F-keys after the last used one.
FUN EXEC 64 41 will display F64,F63, .... to F41.
- Recognises new MODE KEYPAD to display the keypad '*', '-', '=', labels.
- In addition to FUN LP there is now FUN LPFILE which generates an LP
style report but saves it to a file.
- NOT removed as a synonym of NOMODE.
The initial values for an INTEGER or STRING can be full int/str expressions
using functions.
Modes
-----
Mode KEYPAD to use true keypad key labels in FUN EXEC.
Mode TRIM trims trailing spaces from any text line read or written by Open/ed.
Mode IISINPUT is renamed ISINPUT with abbrev ISIN.
Functions
---------
New
---
Function FUNNEL()
Syntax let int# = funnel ( low, test_integer, high )
Description Adjust an integer to be within a low/high range.
If the integer is within the range, it is unchanged.
Function ISALTERN()
Syntax let int# = isaltern ( integer )
Description Is the character an alternate character ?
Return true is the character has the left most bit on.
Function ISPARITY()
Syntax let int# = isparity ( integer )
Description Does the character have the high bit on ?
Return true is the character has the left most bit on.
Function AREEMPTY ( string )
String is NUL, or 1 or more spaces.
Function GETCHAR ( )
Read a character from stdin.
Function PUTCHAR ( int )
Write a character to stdout.
Function PRINT()
Syntax let str# = print ( "string" , Ascii_method , cc_method )
Description Format a string similar to a line displayed by the PRINT command.
Function ISEMPTY()
Syntax let int# = isempty ( character-integer )
Is the character a space or NUL ?
Returns true (>0) if the character represented by integer
is a space (040) or NUL (000).
Function ITEMS(), FIELDS(), LINES()
Syntax let int# = items ( list , sep_char )
Count the number of items in a list.
Analogous to ITEM(), FIELD() and LINE().
Changes
-------
Function EXTRACT()
Syntax let str# = EXTRACT ( 'key_char', source, column )
Description Extract will examine the text in the 'source' string and
extract a token following the rules given by the 'key'.
Key has been enhanced to allow for many more types.
STRFILL()
The FILL() function is renamed STRFILL().
The character argument is now a single quoted character or its integer value.
FLOCK()
An extra argument has been added in the 2nd position for 'maximum_attempts',
the maximum number of time to attempt to get a lock.
GETCHAR() -> GETKEY()
The GETCHAR() function is renamed GETKEY().
The NO () synonym for NONE () is removed.
The LENGTH() function returns the recorded length of a string.
The STRLEN() function recalculates the length from string text.
STRFILL() no longer has any default arguments.
LAST() starts its search at the length of the string. If the string
to be seached is 8 bytes long, the search starts at column 8.
STRCOUNT ( , , count ) Count argument documented.
The PARSE() function now recognises quoted strings.
It is now both a string and integer function.
The SYSTEM() function now requires an error code variable.
If system() could not be run, a negative function value is returned.
The errno code is returned in the error code variable.
The ERRORSTR() function is renamed STRERROR().
The STRCH() abbreviation for STRCHANGE() has been removed.
The FGETS() and FPUTS() functions have had two aruments swapped to be
more in line with the Unix functions.
string, now comes before the file variable.
This affects the two versions of FGETS(), int and string versions,
and the integer FPUTS() function.
Also FGETLINE() has been changed to match this.
It was int = fgetline ( file , string , errror_code )
It is now int = fgetline ( string , file , errror_code )
The integer version of ASCII() is deprecated.
The string version of ASCII() is renamed SINCH() "single char".
QUERY() now defaults to a NUL string. No prompt.
ETIME() is renamed ELTIME().
FILL() is renamed STRFILL().
CHAR() RHS CHAR(str,column) column now defaults to 1 if string length was 1.
This allows a single character to be more easily passed to a subroutine.
subroutine fill_line
int fill_ch = char ("%1%")
let text=strfill(%fill_ch%,80)
return
Variables
---------
New variables :
Variable : %tag.last%
Result : The number of lines tagged by the last TAG command executed.
Variable : %nice%
Result : The current NICE factor.
See the NICE command.
Removed variables :
%text.full% is removed.
%spaces% is removed.
The file# variables are now fil#.
Constants
---------
Constant : %STR_MAX%
Result : The largest possible size of a string variable.
Constant : %SCHAR_MIN% and %SCHAR_MAX%
Result : The minimum and maximum values of a signed char on this platform.
The constant PRINT_OFF is renamed to PRINT_TEXT_NONE.
All of the PRINT_ constants are renamed to
- PRINT_TEXT_xxxx for printable characters,
- PRINT_CC_xxxx for non printable characters,
See the CONSTANTS help entry.
Maths operators
---------------
None.
Symbols
-------
Symbol TAB deprecated. Made the same as ESCAPE.
Macros
------
grepfn Grep reporting file names.
catl.ned is merged with cat.ned.
safe.ned Safely take a copy of the original file before saving. (beta).
life.ned A multi-species life simulator.
Screen mode window.
-------------------
In a batch session, i.e. when the -batch flag is used, and screen mode
has no input, then Open/ed will exit the session.
Menus
-----
FUN EXEC has been tidied and checks MODE KEYPAD.
Keyboard
--------
Help.
-----
There has been a significant re-org of help filles. The 'FUNCTION' and
MODE help entries have had all their entries broken out into
individual entries. You will see this when looking at the help index
with the HELP command, or menu, or APRO results.
ENDO, ENDWHILE, ELSE and ENDIF entries have been wound into
DO, WHILE and IF entries.
Scripts
-------
A few scripts that may be helpfull have been added :
bob : Build object files. The compile script.
blib : Build library.
brun : Build a run file.
These scripts require Korn shell to be installed.
Error codes
-----------
Note : Error codes may have their numeric values changed slightly.
Never hard code numeric error code values.
Use the %Exxxxx% constants.
ECONFIG "Compile time configuration error".
ETERM "Open/ed stopped because of a termination signal".
Bug fixes
---------
19.16.12
19-001 19.10.26 /;/ not working. Must be "^;" so tokens sees it is text.
19-002 19.13.18 Fix Doh! bug in heapunlink(). int.count set to 0 in string code.
19-003 Record number error if ned file not exist. Added setnul to nedmallocs.
19-004 Fix write lines skipping empty lines.
19-005 SHIFT internal error message if start after text.
19-006 Bug : We are clearing stack level 1 (tty).
19-007 Bug : NED command was corrupting its args. No -> s.
19-008 Bug : LEARN was doing a putline() with \n.
19-009 Bug : Shift Count not allowing -ve.
19-010 Bug : IDCHAR/DCHAR count ignored.
19-011 Bug : LHS CHAR(,column) limited to LINESZ.
19-012 Bug : macro.clargs was clearing external -a args in initial().
19-013 named/heap vars ex. EMINE gets Unrecognisable variable error message.
and EOL_xxx and time.xxx and date.xxx
19-014 ECODES are not in getvar() so cant be subscript.
19-015 time.mine is getting an "Unrecognised var" error in isasysvar().
19-016 named variable names reads var name token twice reporting on '='.
Source code Stats
-----------------
Open/ed Rev 19. at 19.17.27
Release at 19.18.01
ned Total size is 82575 lines, 3M bytes, averaging 40 bytes per line.
gstlib Total size is 11774 lines, 413K bytes, averaging 35 bytes per line.
curwin Total size is 6276 lines, 234K bytes, averaging 37 bytes per line.
gpl Total size is 10072 lines, 309K bytes, averaging 30 bytes per line.
include Total size is 4478 lines, 200K bytes, averaging 44 bytes per line.
Grand total 115175 lines.
Other
-----
--------------------------------------------------------------------------------