Menu

SVN-Code Commit Log


Commit Date  
[r13046] by mikeaubury

.NET: protocol probe covers MENU; two mismatches it found

The probe now compares canonical JSON rather than text. The C wraps its
output in an envelope and spreads nested objects over many lines, so a
textual diff was only testing formatting; both streams are now parsed
and re-emitted sorted, with the C's array terminators dropped.

Two real differences surfaced once MENU was covered:

Dialog contexts were numbered from 1 here and from 0 in the C. Clients
key on the value, so they now start at 0.

EXIT MENU compiles to a menu action entry the C sends alongside the
commands - {"ACTION":"fgl_exit_menu","CMD_NO_TIMEOUT":n} - which was
never emitted. AddAction() sends it, so a menu built here is the same
menu on the wire.

Eight messages now identical, including the whole nested MENU.

2026-09-02 07:02:03 Tree
[r13045] by mikeaubury

.NET: protocol-level fidelity probe, and a row/column fix it found

dotnet/fidelity/ui/ runs the same sequence of UI operations through both
runtimes and diffs the message streams. The envelope and PROGRAMSTARTUP
are filtered out - a .NET program does not reproduce those and should
not - so what is compared is the message bodies.

It failed on its first run, and the bug was mine: in DISPLAYAT, X is the
COLUMN and Y is the ROW, so 4GL's "AT row, column" is transposed on the
wire. I had it the wrong way round in both the probe and the reference
example, where DISPLAY ... AT n, 1 was emitting X:n, Y:1. It only shows
up when the row and column differ, which is why AT 1,1 looked fine.

Now six messages byte-identical across the two runtimes. DisplayAt says
which field is which, so it does not get repeated.

2026-09-02 06:53:09 Tree
[r13044] by mikeaubury

.NET: complete UI protocol coverage

The remaining 38 verbs, with field names and order transcribed from the
format strings in lib/libui/ui_json. All 66 verbs the C runtime emits
now have a .NET counterpart.

A coverage test guards it: it lists every verb the C emits and fails if
one has no .NET message, which is the only way a protocol split across
two runtimes stays in step. A second test rejects two messages claiming
the same verb - which immediately caught WAITFOREVENT being declared
twice. The C emits it both bare and with CONTEXT/CACHED, so one type now
covers both and omits the fields rather than sending nulls.

2026-09-02 06:51:35 Tree
[r13043] by mikeaubury

.NET: CONSTRUCT, DISPLAY ARRAY and INPUT ARRAY

CONSTRUCT is close to INPUT but not the same - no WITHOUT_DEFAULTS, and
a Columns array naming the database column each screen field searches,
which is what the WHERE clause it produces is written in terms of.

The array dialogs send their rows up front. Row data keeps its padding,
unlike a menu option's text, because it fills fixed-width screen fields.
ARRLINE and SCRLINE are tracked separately: they differ once the list
has scrolled, and conflating them is a standard porting bug.

INPUT ARRAY turned out not to be DISPLAY ARRAY with a different verb -
it carries MAXARRSIZE, WITHOUT_DEFAULTS, ALLOWINSERT, ALLOWDELETE,
NONEWLINES and WRAP as well. Caught by checking the emitter rather than
assuming the two matched.

2026-09-02 06:49:04 Tree
[r13042] by mikeaubury

.NET: INPUT dialog

Modelled from what the C runtime emits for INPUT BY NAME, not from the
source. Three details that only show up in the real output: Fields is
not null-terminated while Events is, event entries use a lowercase
"event" key rather than "type", and event ids are 1-based.

The dialog is declared once - fields, then the events wanted - and the
client drives it, reporting each event by id. Field values arrive with
the events (the reply's SVS array of FN/FT/T/Value) and accumulate, so
a program reads them by name and field_touched() works.

Nested arrays now carry their own null-termination flag, since MENU and
INPUT disagree about it.

2026-09-02 06:45:14 Tree
[r13041] by mikeaubury

.NET MENU: variable option names, and SHOW/HIDE/NEXT OPTION

COMMAND takes char_or_var_vl, so an option's name is often a variable
and only known at run time. Two consequences, both verified against the
C runtime:

Option text is trimmed before it goes on the wire - a CHAR(20) variable
holding "Customer" must not reach the client as "Customer ".
The menu title is deliberately NOT trimmed, because the C does not trim
it either.

SHOW OPTION, HIDE OPTION and NEXT OPTION address an option by its text
rather than its position, so they take a string. The enum still names
the COMMAND clause for dispatch - the clause count is fixed by the
source however dynamic the names are - and TextOf() maps a clause back
to its current text for callers that only hold the enum.

2026-09-02 06:38:11 Tree
[r13040] by mikeaubury

UI protocol: normalise remaining field names; .NET MENU support

Two more lowercase field names missed by r13038, both found by checking
the uilib layer rather than only json.c/xml.c: a second OPTIONS emitter
in ui_json/uilib/uilib.c, and CLEAR's todefault. All emitters now use
one casing for scalar fields; TitleCase names like Fields and
MenuCommands are nested payloads and are left as they are.

.NET: MENU over the wire, checked against what the C runtime actually
emits rather than against the source - which corrected three things.
The objects nested in MenuCommands carry no "type" field, their ids are
1-based, and they include KEYS and HELPNO. That needed a UiPayload /
UiMessage split, since only top-level messages carry a verb.

Menu commands are identified by a caller-supplied enum, so generated
dispatch reads as "case MainMenu.Customer" rather than the old
"case 0: /* COMMAND */".

2026-09-02 06:28:32 Tree
[r13039] by mikeaubury

.NET: reference program pinning what the generator should emit

dotnet/examples/ pairs a 4GL program with the C# the generator should
produce for it, hand-written so the target shape is settled before the
generator is pointed at it. It covers the cases the 2012 output got
wrong: MONEY (which emitted "unknown_8"), CHAR padding, a NULL that has
to survive the round trip, a cursor loop, and NOTFOUND as a status
rather than an error.

End-to-end tests run it against SQLite with a recording UI channel, a
JSON channel, and no channel at all - proving a generated program needs
neither a screen nor Informix to run or be tested. The session now
carries the UI channel alongside SQL and status.

2026-09-02 06:15:07 Tree
[r13038] by mikeaubury

Maths builtins, CHAR UTF-8 truncation, UI protocol names, .NET runtime

ROUND/TRUNC/MOD/POW/EXP/LOGN/LOG10 were "not implemented" stubs and
failed to link. Implemented in builtin_d.c. ROUND and TRUNC work on the
decimal text rather than the double, so ROUND(1.005,2) gives 1.01 and
agrees with LET onto a DECIMAL(10,2); rounding the double gave 1.00.
Not added to std_funcs.c - that would reserve the names and break
programs defining their own, as tools/misql/coxxc04.4gl does.

CHAR(n) truncation could cut a UTF-8 character in half and leave invalid
bytes in the field. A4GL_trim_partial_char blanks a partial trailing
character; the field keeps its width and ASCII is unaffected.

UI protocol field names made consistent: MOVEWINDOW sent x/y, OPTIONS
sent option/value and WAITFOREVENT sent context, against uppercase
everywhere else. MOVEWINDOW was also emitting a malformed tag on both
XML paths (a stray / mid-tag). The Angular OPTIONS handler now accepts
the old and new names, so it works against either runtime.

dotnet/: .NET 8 runtime - 4GL types (CHAR/NCHAR as one character-counted
type, decimal for DECIMAL and MONEY, DateOnly for DATE, qualified
DATETIME and INTERVAL), SQL over a pluggable driver chosen by
A4GL_SQLTYPE with no provider dependency in the core, and the UI
protocol channel. 71 tests, plus a harness that runs the same probe
through both runtimes and diffs them.

Also adds 24 ExtJS command handlers that were never committed.

2026-09-02 06:12:44 Tree
[r13037] by mikeaubury

Restore the install file lists, so `make install` installs something.

The rewrite replaced a dozen lists that the old configure.in computed with
AC_SUBST(..., []) stubs. Every one of them feeds a
cp $(addprefix $(SOMEWHERE_DIR)/, $(SOMETHING_FILES)) $(DEST)
so an empty list became "cp <destination>" with no source, and the install
died at the first one. Worse, the executable lists were among them, so
even after getting past that nothing in bin was ever copied - an install
tree kept serving whatever binaries it already had, however many times the
source was rebuilt.

Restored, from what the old configure.in did:

FGLPC_SETTINGS_FILES listed from tools/4glpc/settings
ETC_FILES IMPORT_FILES CONVSQL_FILES listed from their directories
ROOT_FILES ALL_INC ALL_DOC explicit lists, existence filtered
ALL_SH AMAKE_SH AMAKE_BIN_EXE COMP_EXE RUNTIME_EXE the programs

AUBITETC was also being substituted as the literal '${prefix}/etc/aubit4gl'.
Makefile-common defines no 'prefix', so it collapsed to /etc/aubit4gl -
root owned, and the install failed for anyone not installing as root. It is
now expanded at configure time.

And the default prefix gets its writability check back: the old
configure.in fell back to a prefix under $HOME when /opt was not writable,
which the rewrite had dropped. An explicit --prefix is still honoured
exactly as given.

`make install` now completes and installs the programs.

2026-09-01 17:32:27 Tree
Older >