5
Try to start the program from both cli and wb.
6
If from wb then click also on the icons, arg1.info,
7
arg2.info and arg3.info.
10
Changed to use MessagBox, to show the workbench
11
args create an icon for wbtest.
14
nils.sjoholm@mailbox.swipnet.se
24
Function IntToStr (I : Longint) : String;
34
if not isconsole then begin
35
dummy := 'started from wb' +#10;
36
dummy := dummy + 'The Programs name is: ' + ProgramName +#10;
37
dummy := dummy + 'Number of args are: ' + inttostr(WBArgCount) +#10;
38
if WBArgCount > 0 then begin
39
dummy := dummy + 'And the args are:' +#10;
40
for i := 1 to WBArgCount do dummy := dummy + 'Arg number ' + inttostr(i) +
41
' is: ' + GetWBArg(i) +#10;
43
dummy := dummy + 'The programs name with GetWBArg(0) is: ' + GetWBArg(0);
44
MessageBox('FPC WorkBench', dummy, 'Nice');
46
writeln('started fromcli');
47
writeln('The program name is: ',ProgramName);
48
writeln('Number of args are: ',ParamCount);
49
if ParamCount > 0 then begin
50
writeln('And the args are:');
51
for i := 1 to ParamCount do writeln('Arg number ',i,' is: ',ParamStr(i));
53
writeln('The programs name with ParamStr(0) is: ',ParamStr(0));