Harbourino idea: form fields as template blocks
I’m posting this here because the Harbourino style works with FiveWin in exactly the same way.
While experimenting today, I built a small example that simplifies a very common problem: repeating HTML form patterns everywhere.
Typical pattern:
<div class="group">
<label>|caption|</label>
<input id="|id|" value="<?= htmlspecialchars($record['|id|'] ?? '') ?>">
</div>Instead of repeating this block across many files, Harbourino could allow something like:
$->CFIELD : caption = Meldeblatt-Nr. ; id = MELDEBLATTwhich expands to the HTML above.
Why this helps
Most forms repeat the same structure dozens of times.
With a template block, you can centralize things like:
- CSS classes
- validation
- default attributes
- escaping
- icons
- required markers
- responsive layout
Change it once in the template, and every field benefits.
Example.
Before
<div class="group">
<label>Telefax</label>
<input id="FAX" value="<?= htmlspecialchars($record['FAX'] ?? '') ?>">
</div>After
$->CFIELD : caption = Telefax ; id = FAXLater I can change the template to:
<input class="input" type="text" autocomplete="off">…and it automatically applies everywhere.
---
Possible naming scheme
Classic Harbour style:
GET
GETDATE
GETNUM
MEMO
COMBOBut that may be a bit cryptic for non-Harbour developers.
Current idea:
CFIELD text
NFIELD number
DFIELD date
MFIELD textarea
COMBO select
CHECK checkboxExample form:
$->CFIELD : caption = Beruf ; id = BERUF
$->CFIELD : caption = Meldeblatt-Nr. ; id = MELDEBLATT
$->CFIELD : caption = Zusatz ; id = ZUSATZ
$->NFIELD : caption = Rabatt % ; id = RABATT
$->CFIELD : caption = Telefax ; id = FAX
$->DFIELD : caption = Hochzeitstag ; id = HOCHZEITSTAG
$->MFIELD : caption = History ; id = HISTORYMuch easier to read and maintain.
---
Possible extensions
Because everything is abstracted, additional options become trivial:
$->CFIELD : caption = Name ; id = NAME ; required
$->CFIELD : caption = Beruf ; id = BERUF ; placeholder = Beruf
$->NFIELD : caption = Rabatt % ; id = RABATT ; type = numberAt that point Harbourino starts to look like a small form DSL.
---
Important design goal
Harbourino does not exist at runtime.
The syntax is only used during the build / patch process.
After compilation, the code deployed to the server is plain HTML, JavaScript, prg, or PHP.
So Harbourino acts purely as a development-time abstraction layer.
You get:
- less repetitive code
- easier maintenance
- no framework overhead
- clean native output on the server


