Init.txt 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. MODULE Init;
  2. IMPORT
  3. Kernel,
  4. HostConsole (* Console.SetHook *) ,
  5. HostFonts (* Fonts.SetHook; required for Texts *),
  6. HostWindows (* Windows.SetHook *),
  7. HostDates (* Dates.SetHook *),
  8. HostDialog (* Dialog.SetShowHook *),
  9. StdInterpreter (* Dialog.SetCallHook *) ,
  10. StdDialog (* Views.SetViewHook *),
  11. Log, ConsLog, (* Log.Hook *)
  12. Strings,
  13. Converters (* .odc *),
  14. Dialog;
  15. PROCEDURE Init;
  16. VAR
  17. c1, c2, res: INTEGER; a, b: REAL;
  18. BEGIN
  19. IF Kernel.bootInfo.argc = 3 THEN
  20. Strings.StringToReal(Kernel.bootInfo.argv[1]$, a, c1);
  21. Strings.StringToReal(Kernel.bootInfo.argv[2]$, b, c2);
  22. IF (c1 = 0) & (c2 = 0) THEN
  23. Log.String("Summ: "); Log.Real(a + b); Log.Ln
  24. ELSE
  25. Log.String("The arguments should be in the form of real: 13123.556"); Log.Ln
  26. END
  27. ELSE
  28. Log.String("Example of simple console application based on BlackBox Component Builder."); Log.Ln;
  29. Log.String("You can pass two arguments and sum of them will be returned."); Log.Ln
  30. END
  31. END Init;
  32. BEGIN
  33. Init
  34. END Init.