Skip to content

Four legacy command forms from a FoxPro 2.x-era codebase #31

Open

Description

@ilpconsulting

Four syntax forms that VFP 9 accepts and FoxDev rejects at compile time. We found all of them in a real application with a long history. Each one stops the whole file from compiling.

1. INDEX COMPACT ON ... TO (COMPACT before ON)

CREATE CURSOR t (cdes C(10))
INDEX COMPACT ON UPPER(cdes) TO (ADDBS(SYS(2023))+"t1")   && error: INDEX needs ON and a key expression
INDEX ON cdes TO (ADDBS(SYS(2023))+"t2") COMPACT          && OK

Expected: both forms compile and build the same compact .IDX file.

2. SELECT <array element> is taken for SQL SELECT

LOCAL ARRAY aa[1,2]
CREATE CURSOR t (f1 C(1))
aa[1,2] = "t"
SELECT aa[1,2]      && error: SELECT needs a FROM clause
SELECT (aa[1,2])    && OK

Expected: SELECT <name>[...] with no field list and no FROM is the work-area command, as in VFP 9.

3. ??? (raw output to the printer)

SET PRINTER TO FILE (ADDBS(SYS(2023))+"p.txt")
??? CHR(27)+"@"     && error: expected expression, found '?'
??? ""
SET PRINTER TO

Expected: ??? sends its characters to the printer / SET PRINTER TO FILE target with no translation. Programs use it to send escape sequences straight to the printer. If raw printer output isn't planned, please list it as "Refused, by name" in language-coverage.md rather than leave it as a parse error.

4. APPEND FROM ... DELIMITED WITH <c> WITH CHARACTER <c>

CREATE CURSOR t (a C(5), b C(5))
APPEND FROM (ADDBS(SYS(2023))+"x.txt") DELIMITED WITH "" WITH CHARACTER |

→ error 2:73 Unexpected character '|' and error 2:74 expected expression, found end of line

Expected: as in VFP 9, the WITH CHARACTER delimiter is a bare single character (|, ;, TAB, BLANK), not an expression. The same clause appears in COPY TO ... DELIMITED.

Environment: foxvm 0.1.0-nightly.20261007.f38230f, win-x64.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions