Phase 0.1: Referenzen gegen Original-Dokumentation verifiziert
Drei parallele Recherchen ueber die Original-Hilfedateien des Vorbilds (dos-help.soulsphere.org, dekodierte VBDOS.HLP, CONSTANT.BI, README der Professional Edition) eingearbeitet: - Sprachreferenz: OPTION EXPLICIT und ON [LOCAL] ERROR RESUME NEXT existieren; Zeilenfortsetzung mit Underscore; Literalregeln; Limits (40-Zeichen-Bezeichner, 60 Array-Dimensionen); Event-Traps inkl. UEVENT; PRINT-USING-Zeichen inkl. **$; native Datumsfunktionen (NOW, DATESERIAL, ...) und FORMAT$; MSGBOX/INPUTBOX$-Signaturen - Forms-Referenz komplett neu: alle 16 Steuerelemente mit Eigenschaften/ Methoden/Ereignissen, Default-Tabelle, SCREEN-Objekt inkl. ControlPanel, Koordinaten in Zellen (0-254), Modalitaet (SHOW 0/1), Menuesystem, Control-Arrays, Drag&Drop; keine Default-Eigenschaften - Neue IDE-Referenz (docs/ide-referenz.md): Menuestruktur, Fenster- verwaltung, Form Designer, Farbschema, Tastenbelegung, Statuszeile - Fehlerkatalog vervollstaendigt: ISAM 80-89 und Forms 260-480, Code-Typ auf u16 erweitert, Tests ergaenzt - Dateiformate: .MAK-Format belegt, .FRM binaer/Text geklaert Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
//! Laufzeitfehler: Codes und Meldungstexte kompatibel zum Vorbild.
|
||||
//!
|
||||
//! Die Codes und (englischen) Meldungstexte entsprechen dem klassischen
|
||||
//! DOS-BASIC-Katalog; Programme prüfen `ERR` gegen diese Nummern, daher
|
||||
//! sind sie Teil des Kompatibilitätsvertrags. Nicht belegte Nummern
|
||||
//! liefern "Unprintable error" (wie im Vorbild bei `ERROR n`).
|
||||
//! Die Codes und (englischen) Meldungstexte entsprechen dem Katalog des
|
||||
//! Vorbilds (Original-Hilfe, Topic „Run-Time Error Codes"): klassische
|
||||
//! Codes 1–76 (QB-Erbe), 80–89 (ISAM), 260–480 (Forms). Programme prüfen
|
||||
//! `ERR` gegen diese Nummern, daher sind sie Teil des Kompatibilitäts-
|
||||
//! vertrags. Nicht belegte Nummern liefern "Unprintable error" (wie im
|
||||
//! Vorbild bei `ERROR n`); Nummer 105 ist im Vorbild intern reserviert.
|
||||
|
||||
/// Ein Laufzeitfehler des Dialekts, identifiziert durch seinen klassischen Code.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct RuntimeError(pub u8);
|
||||
pub struct RuntimeError(pub u16);
|
||||
|
||||
impl RuntimeError {
|
||||
pub const NEXT_WITHOUT_FOR: Self = Self(1);
|
||||
@@ -64,9 +66,15 @@ impl RuntimeError {
|
||||
pub const RENAME_ACROSS_DISKS: Self = Self(74);
|
||||
pub const PATH_FILE_ACCESS_ERROR: Self = Self(75);
|
||||
pub const PATH_NOT_FOUND: Self = Self(76);
|
||||
// Forms-Fehler (Auswahl mit benannten Konstanten; vollständige Texte in message()):
|
||||
pub const INVALID_SCREEN_MODE: Self = Self(271);
|
||||
pub const INVALID_WHEN_FORMS_SHOWING: Self = Self(272);
|
||||
pub const INVALID_PROPERTY_VALUE: Self = Self(380);
|
||||
pub const NO_ACTIVE_CONTROL: Self = Self(430);
|
||||
pub const NO_ACTIVE_FORM: Self = Self(431);
|
||||
|
||||
/// Klassischer Fehlercode für `ERR`.
|
||||
pub fn code(self) -> u8 {
|
||||
pub fn code(self) -> u16 {
|
||||
self.0
|
||||
}
|
||||
|
||||
@@ -124,9 +132,59 @@ impl RuntimeError {
|
||||
71 => "Disk not ready",
|
||||
72 => "Disk-media error",
|
||||
73 => "Feature unavailable",
|
||||
74 => "Rename across disks",
|
||||
74 => "Can't rename with different drive",
|
||||
75 => "Path/File access error",
|
||||
76 => "Path not found",
|
||||
// ISAM (PDS-Erbe) — Terminal Basic implementiert ISAM nicht,
|
||||
// die Codes/Texte gehören aber zum Kompatibilitätsvertrag.
|
||||
80 => "Feature removed",
|
||||
81 => "ISAM - Invalid name",
|
||||
82 => "ISAM - Table not found",
|
||||
83 => "ISAM - Index not found",
|
||||
84 => "ISAM - Invalid column",
|
||||
85 => "ISAM - No current record",
|
||||
86 => "ISAM - Duplicate value for unique index",
|
||||
87 => "ISAM - Invalid operation on NULL index",
|
||||
88 => "ISAM - Database inconsistent",
|
||||
89 => "ISAM - Insufficient ISAM buffers",
|
||||
// Forms-Fehler des Vorbilds
|
||||
260 => "No timer available",
|
||||
271 => "Invalid screen mode",
|
||||
272 => "Invalid when forms are showing",
|
||||
340 => "Control array element does not exist",
|
||||
341 => "Invalid object array index",
|
||||
342 => "Not enough room to allocate control array",
|
||||
343 => "Object not an array",
|
||||
344 => "Must specify index for object array",
|
||||
345 => "Reached limit: cannot create any more controls for this form",
|
||||
360 => "Object already loaded",
|
||||
361 => "Can't load or unload this object",
|
||||
362 => "Can't unload controls created at design time",
|
||||
363 => "Custom control not found",
|
||||
364 => "Object was unloaded",
|
||||
365 => "Unable to unload within this context",
|
||||
380 => "Invalid property value",
|
||||
381 => "Invalid property array index",
|
||||
382 => "Property can't be set at run time",
|
||||
383 => "Property is read-only",
|
||||
384 => "Property can't be modified when form is minimized or maximized",
|
||||
385 => "Must specify index when using property array",
|
||||
386 => "Property not available at run time",
|
||||
387 => "Property can't be set on this control",
|
||||
400 => "Form already displayed; can't show form modally",
|
||||
401 => "Can't show non-modal form when a modal form is being displayed",
|
||||
402 => "Must close or hide topmost modal form first",
|
||||
403 => "MDI form cannot be shown modally",
|
||||
410 => "Property can't be modified on MDI form",
|
||||
420 => "Invalid object reference",
|
||||
421 => "Method not applicable for this object",
|
||||
422 => "Property not found",
|
||||
423 => "Property or control not found",
|
||||
424 => "Object required",
|
||||
425 => "Invalid object use",
|
||||
430 => "No currently active control",
|
||||
431 => "No currently active form",
|
||||
480 => "Can't create AutoRedraw image",
|
||||
_ => "Unprintable error",
|
||||
}
|
||||
}
|
||||
@@ -153,9 +211,22 @@ mod tests {
|
||||
assert_eq!(RuntimeError::FEATURE_UNAVAILABLE.code(), 73);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn forms_und_isam_codes() {
|
||||
assert_eq!(RuntimeError(80).message(), "Feature removed");
|
||||
assert_eq!(
|
||||
RuntimeError::INVALID_WHEN_FORMS_SHOWING.message(),
|
||||
"Invalid when forms are showing"
|
||||
);
|
||||
assert_eq!(RuntimeError::NO_ACTIVE_FORM.code(), 431);
|
||||
assert_eq!(RuntimeError(403).message(), "MDI form cannot be shown modally");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unbelegte_codes_sind_unprintable() {
|
||||
assert_eq!(RuntimeError(15).message(), "Unprintable error");
|
||||
assert_eq!(RuntimeError(105).message(), "Unprintable error"); // intern reserviert
|
||||
assert_eq!(RuntimeError(200).message(), "Unprintable error");
|
||||
assert_eq!(RuntimeError(500).message(), "Unprintable error");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user