https://github.com/axtens/rst
An xBase DBF resturcturer written in Fitted Software Tools Modula-2, generating Clipper 5.2 code
https://github.com/axtens/rst
Last synced: 3 months ago
JSON representation
An xBase DBF resturcturer written in Fitted Software Tools Modula-2, generating Clipper 5.2 code
- Host: GitHub
- URL: https://github.com/axtens/rst
- Owner: axtens
- License: mit
- Created: 2019-08-03T05:10:53.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-08-21T13:42:14.000Z (almost 4 years ago)
- Last Synced: 2025-01-31T06:41:55.145Z (over 1 year ago)
- Language: Modula-2
- Size: 25.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rst
An xBase DBF resturcturer written in Fitted Software Tools Modula-2, generating Clipper 5.2 code
I was working for a construction company. They had many DBF files that they were wanting to restructure. RST was one of the ways I thought of to automate the procedure.
RST uses RESTRU.EXE (written in Modula-2) to parse a job description in an file with an .RST extension. RESTRU.EXE, from the description, generates a Clipper 5.2 PRG file for subsequent compilation and execution.
For example, DEFAULT.RST
```
res thing
chg fldname name fld type c len 20
go
code ? "hello world"
```
RESTRU turns that into
```
USE thing ALIAS RST NEW
aFileArray := dbstruct()
n := ASCAN( aFileArray, { |aVal| aVal[1] == [FLDNAME] } )
IF n <> 0
aFileArray[n][1] := [FLD]
aFileArray[n][2] := [C]
aFileArray[n][3] := 20
END
COPY TO TEMP
ERASE thing.DBF
dbcreate( [thing], aFileArray)
USE thing NEW
APPEND FROM TEMP
CLOSE DATABASES
ERASE TEMP.DBF
? "hello world"
```
See the [xlb](https://github.com/axtens/xlb) project for required non-FST libraries.
Building and/or converting to another Modula-2 is left as a task for the reader and/or the author should he find the time.
Other Modula-2 compilers: [M2F](http://floppsie.comp.glam.ac.uk/Glamorgan/gaius/web/m2fabout.html), [GNU Modula-2](https://www.nongnu.org/gm2/download.html), [XDS](https://github.com/excelsior-oss/xds) and [ADW](https://www.modula2.org/adwm2/).
Other good Modula-2 information can be found at [Peter Moylan](http://www.pmoylan.org/pages/m2/Modula2.html)'s site.