DEADSOFTWARE

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