Repository navigation
Class property expressions, class-body arrays, SYS(2007), SET switch words - #9
Conversation
…words Found running a CodeMine application (Shutter Ace); each behaviour measured in Visual FoxPro 9 first, with goldens whose .expected vfp9.exe wrote. - A DEFINE CLASS property value that is an expression - QuickBooksInvoice's TxnDate = TRANSFORM(DTOS(DATE()), "@r xxxx-xx-xx") - is kept as source and worked out at CREATEOBJECT(), where CREATEOBJECT() was called, so a variable set just before it is seen. A subclass's constant still wins over it. It was a compile error. Evaluating in a fiber that is waiting on the host no longer drops the answer that fiber is waiting for. - A class body can set an array property whole (every element) or one element of it: `DIMENSION wbaSearchOrder[7]` then `wbaSearchOrder[1] = "WIZARDS"`, as Microsoft's own wbmain.prg does. - SYS(2007): CRC-16/CCITT from 0xFFFF or from the seed given, and CRC-32 with flag 1. CodeMine validates serial numbers with it. - Words after a SET switch are read: SET COMPATIBLE ... PROMPT | NOPROMPT is what SET("COMPATIBLE", 1) answers; the words after others change nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RandomChirp
left a comment
There was a problem hiding this comment.
Measured in vfp9.exe: a class property written as an expression is worked out when the object is made, in the caller's scope (nBase = 7 just before CREATEOBJECT gives nFromVar 8), a subclass constant wins over the parent's expression (cchild.nSum 20), and DATE() there is a date. The three goldens (class_array_elements, set_switch_words, sys_checksum) agree with the product, and cargo test -p foxvm is green on a merge with main.
One small thing, not blocking: SYS(2007) takes the low byte of each char, which folds any character above 255 into a byte the product would never see. The strings the VM holds are single-byte in practice, so it is fine today; a comment saying so would stop someone reading it as a bug.
Review generated with Claude Code (Claude Fable 5.1), run against vfp9.exe and the test suites on a merge with main.
Found running a CodeMine application (Shutter Ace); each behaviour measured in
Visual FoxPro 9 first, with goldens whose .expected vfp9.exe wrote.
TxnDate = TRANSFORM(DTOS(DATE()), "@r xxxx-xx-xx") - is kept as source and
worked out at CREATEOBJECT(), where CREATEOBJECT() was called, so a variable
set just before it is seen. A subclass's constant still wins over it. It was
a compile error. Evaluating in a fiber that is waiting on the host no longer
drops the answer that fiber is waiting for.
of it:
DIMENSION wbaSearchOrder[7]thenwbaSearchOrder[1] = "WIZARDS",as Microsoft's own wbmain.prg does.
flag 1. CodeMine validates serial numbers with it.
what SET("COMPATIBLE", 1) answers; the words after others change nothing.
Verification. Goldens
class_array_elements,sys_checksumandset_switch_words(each.expectedwritten byvfp9.exe),tests/runtime/classPropertyExpressions.test.ts, and an updated case incrates/foxvm/tests/classes.rs. The full VM suite and the runtime, shared, vfp and reference TypeScript tests pass on this branch.One of several pull requests split out of work on a CodeMine application (Shutter Ace); each stands on main on its own except where it says otherwise.
🤖 Generated with Claude Code