Win32.Oberon.Mod 835 B

123456789101112131415161718192021222324252627
  1. MODULE Oberon IN A2; (** AUTHOR "negelef"; PURPOSE "Oberon command interpreter interface for A2"; *)
  2. IMPORT Modules, Commands, Strings ;
  3. PROCEDURE Call* (context: Commands.Context);
  4. VAR string, msg: ARRAY 64 OF CHAR; module, command: Modules.Name; res: LONGINT; procedure: PROCEDURE;
  5. BEGIN
  6. context.arg.SkipWhitespace; context.arg.String (string);
  7. Commands.Split (string, module, command, res, msg);
  8. IF res # Commands.Ok THEN
  9. context.error.String (msg); context.error.Ln; RETURN;
  10. END;
  11. Strings.Concat ("Oberon-", module, module);
  12. GETPROCEDURE (module, command, procedure);
  13. IF procedure = NIL THEN
  14. context.error.String ("Oberon command '"); context.error.String (string);
  15. context.error.String ("' not found"); context.error.Ln; RETURN;
  16. END;
  17. procedure;
  18. END Call;
  19. END Oberon.
  20. SystemTools.Free Oberon ~