Text processing/Max licenses in use: Difference between revisions
Text processing/Max licenses in use (view source)
Revision as of 11:44, 14 February 2024
, 3 months ago→{{header|Wren}}: Changed to Wren S/H
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
m (→{{header|Wren}}: Changed to Wren S/H) |
||
(One intermediate revision by one other user not shown) | |||
Line 2,826:
=={{header|Wren}}==
<syntaxhighlight lang="
var lines = File.read("mlijobs.txt").replace("\r", "").split("\n")
Line 2,856:
2008/10/03_08:39:34
2008/10/03_08:40:40
</pre>
=={{header|XPL0}}==
To run: maxlic < mlijobs.txt
<syntaxhighlight lang "XPL0">string 0; \use zero-terminated strings
char TimeMax(100, 25);
int Out, OutMax, I, Ch, ListInx;
[Out:= 0; OutMax:= 0; ListInx:= 0;
loop [for I:= 0 to 9-1 do
[Ch:= ChIn(1);
if Ch = $1A \EOF\ then quit;
];
if Ch = ^O then
[Out:= Out+1;
if Out >= OutMax then
[if Out > OutMax then ListInx:= 0;
OutMax:= Out;
for I:= 0 to 5-1 do Ch:= ChIn(1);
for I:= 0 to 19-1 do
TimeMax(ListInx, I):= ChIn(1);
TimeMax(ListInx, I):= 0;
ListInx:= ListInx+1;
];
]
else \Ch = ^I as in "IN"
Out:= Out-1;
repeat Ch:= ChIn(1) until Ch = $0A; \LF
];
Text(0, "Maximum simultaneous license use is ");
IntOut(0, OutMax);
Text(0, " at the following time(s):^m^j");
for I:= 0 to ListInx-1 do
[Text(0, @TimeMax(I,0)); CrLf(0)];
]</syntaxhighlight>
{{out}}
<pre>
Maximum simultaneous license use is 99 at the following time(s):
2008/10/03_08:39:34
2008/10/03_08:40:40
</pre>
|