source: branches/2.20_branch/NewView/CmdLineParameterUnit.pas@ 482

Last change on this file since 482 was 369, checked in by RBRi, 16 years ago

show more debug info

  • Property svn:eol-style set to native
File size: 21.6 KB
Line 
1Unit CmdLineParameterUnit;
2
3// NewView - a new OS/2 Help Viewer
4// Copyright 2006-2009 Ronald Brill (rbri at rbri dot de)
5// This software is released under the GNU Public License - see readme.txt
6
7// Helper functions to address the command line parameters newview
8// is started with
9
10Interface
11
12uses
13 Os2Def,
14 BseTib,
15 BseDos,
16 SysUtils,
17 Classes,
18 PMWIN,
19 StringUtilsUnit,
20 DebugUnit;
21
22CONST
23 ENV_DEBUG = 'NEWVIEW_DEBUG';
24
25
26 TYPE EParsingFailed=CLASS(Exception);
27
28 TYPE
29 TWindowPosition = record
30 left: longint;
31 bottom: longint;
32 width: longint;
33 height: longint;
34 end;
35 TYPE
36 TCmdLineParameters = class
37 private
38 commandLine : AnsiString;
39 showUsageFlag : boolean;
40 searchFlag : boolean;
41 globalSearchFlag : boolean;
42 language : string;
43 showIndexFlag : boolean;
44 helpManagerFlag : boolean;
45 helpManagerWindow : HWND;
46 windowPositionFlag: boolean;
47 windowPosition: TWindowPosition;
48 ownerWindow : integer;
49 windowTitle : AnsiString;
50 parsedFileNames : AnsiString;
51 parsedRawFileNames : AnsiString;
52 fileNames : AnsiString;
53 parsedSearchText : AnsiString;
54 searchText : AnsiString;
55 debugEnabled : boolean;
56 nhmDebugMessages : TStringList; // for better debugging strange situations
57
58 FUNCTION handleSwitchWithValue(const aSwitchString : String; const aSwitch : String; var aValue : String) : Boolean;
59 PROCEDURE parseSwitch(const aSwitchString : String);
60 PROPERTY getParsedFileNames : AnsiString read parsedFileNames;
61 PROPERTY getParsedSearchText : AnsiString read parsedSearchText;
62
63 public
64 PROPERTY isDebugEnabled : boolean read debugEnabled;
65 PROPERTY getShowUsageFlag : boolean read showUsageFlag;
66 PROPERTY getSearchFlag : boolean read searchFlag;
67 PROPERTY getGlobalSearchFlag : boolean read globalSearchFlag;
68 PROPERTY getLanguage : string read language;
69 PROPERTY getShowIndexFlag : boolean read showIndexFlag;
70 PROPERTY getHelpManagerFlag : boolean read helpManagerFlag;
71 FUNCTION setHelpManagerFlag(const aNewValue : boolean) : boolean;
72 PROPERTY getHelpManagerWindow : HWND read helpManagerWindow;
73 PROPERTY getWindowPositionFlag : boolean read windowPositionFlag;
74 PROPERTY getWindowPosition : TWindowPosition read windowPosition;
75 PROPERTY getOwnerWindow : integer read ownerWindow;
76 PROPERTY getWindowTitle : AnsiString read windowTitle;
77 PROPERTY getSearchText : AnsiString read searchText;
78
79 FUNCTION getFileNames(const aShowNewViewHelpIfNoFileSpecifiedFlag : Boolean) : AnsiString;
80
81 PROCEDURE writeDetailsTo(aStrings : TStrings);
82 PROCEDURE logDetails;
83 PROCEDURE parseCmdLine(const aCmdLineString : AnsiString);
84 FUNCTION getOwnHelpFileName: String;
85 PROCEDURE addNhmDebugMessage(const aString : String);
86 end;
87
88
89 // add all file name parts of aFileNameString to the result
90 // check for containing environment vars
91 // and include all help files if the environment var points
92 // to a directory
93 PROCEDURE ParseAndExpandFileNames(const aFileNameString: String; aResult: TStrings );
94
95
96 // returns a string containing the whole
97 // command line parametes
98 FUNCTION nativeOS2GetCmdLineParameter : AnsiString;
99
100
101Implementation
102uses
103 DOS,
104 FileUtilsUnit,
105 VersionUnit;
106
107 PROCEDURE TCmdLineParameters.writeDetailsTo(aStrings : TStrings);
108 var
109 tmpWindowPosition : TWindowPosition;
110 i : integer;
111 begin
112 aStrings.Add('---- Version ----');
113 aStrings.Add(' ' + GetAppVersion);
114 aStrings.Add('');
115
116 aStrings.Add('---- Command Line ----');
117 aStrings.Add('''' + commandLine + '''');
118 aStrings.Add('isDebugEnabled: ' + boolToStr(isDebugEnabled));
119
120 aStrings.Add('parsed infos:');
121 aStrings.Add(' showUsageFlag: ' + boolToStr(getShowUsageFlag));
122 aStrings.Add(' searchFlag: ' + boolToStr(getSearchFlag));
123 aStrings.Add(' fileNames(true): ' + getFileNames(true));
124 aStrings.Add(' fileNames(false): ' + getFileNames(false));
125 aStrings.Add(' parsedFileNames: ' + getParsedFileNames);
126 aStrings.Add(' searchText: ' + getSearchText);
127 aStrings.Add(' parsedSearchText: ' + getParsedSearchText);
128 aStrings.Add(' globalSearchFlag: ' + boolToStr(getGlobalSearchFlag));
129 aStrings.Add(' language: ' + getLanguage);
130 aStrings.Add(' showIndexFlag: ' + boolToStr(getShowIndexFlag));
131 aStrings.Add(' helpManagerFlag: ' + boolToStr(getHelpManagerFlag));
132 aStrings.Add(' helpManagerWindow: ' + LongWordToStr(getHelpManagerWindow));
133 aStrings.Add(' windowPositionFlag: ' + boolToStr(getWindowPositionFlag));
134
135 tmpWindowPosition := getWindowPosition;
136 aStrings.Add(' windowPosition: '
137 + intToStr(tmpWindowPosition.left) + ', '
138 + intToStr(tmpWindowPosition.bottom) + ', '
139 + intToStr(tmpWindowPosition.width) + ', '
140 + intToStr(tmpWindowPosition.height)
141 );
142 aStrings.Add(' ownerWindow: ' + intToStr(getOwnerWindow));
143 aStrings.Add(' windowTitle: ' + getWindowTitle);
144
145 if nil <> nhmDebugMessages then
146 begin
147 aStrings.Add('');
148 aStrings.Add('---- NHM DebugMessages ----');
149 for i := 0 to nhmDebugMessages.count-1 do
150 begin
151 aStrings.Add(' ' + nhmDebugMessages[i]);
152 end;
153 end;
154
155 end;
156
157
158 PROCEDURE TCmdLineParameters.LogDetails;
159 var
160 tmpWindowPosition : TWindowPosition;
161 i : integer;
162 begin
163 LogEvent(LogStartup, '''' + commandLine + '''');
164 LogEvent(LogStartup, 'isDebugEnabled: ' + boolToStr(isDebugEnabled));
165 LogEvent(LogStartup, 'parsed infos:');
166
167 LogEvent(LogStartup, ' showUsageFlag: ' + boolToStr(getShowUsageFlag));
168 LogEvent(LogStartup, ' searchFlag: ' + boolToStr(getSearchFlag));
169 LogEvent(LogStartup, ' fileNames(true): ' + getFileNames(true));
170 LogEvent(LogStartup, ' fileNames(false): ' + getFileNames(false));
171 LogEvent(LogStartup, ' parsedFileNames: ' + getParsedFileNames);
172 LogEvent(LogStartup, ' searchText: ' + getSearchText);
173 LogEvent(LogStartup, ' parsedSearchText: ' + getParsedSearchText);
174 LogEvent(LogStartup, ' globalSearchFlag: ' + boolToStr(getGlobalSearchFlag));
175 LogEvent(LogStartup, ' language: ' + getLanguage);
176 LogEvent(LogStartup, ' showIndexFlag: ' + boolToStr(getShowIndexFlag));
177 LogEvent(LogStartup, ' helpManagerFlag: ' + boolToStr(getHelpManagerFlag));
178 LogEvent(LogStartup, ' helpManagerWindow: ' + LongWordToStr(getHelpManagerWindow));
179 LogEvent(LogStartup, ' windowPositionFlag: ' + boolToStr(getWindowPositionFlag));
180
181 tmpWindowPosition := getWindowPosition;
182 LogEvent(LogStartup, ' windowPosition: '
183 + intToStr(tmpWindowPosition.left) + ', '
184 + intToStr(tmpWindowPosition.bottom) + ', '
185 + intToStr(tmpWindowPosition.width) + ', '
186 + intToStr(tmpWindowPosition.height)
187 );
188 LogEvent(LogStartup, ' ownerWindow: ' + intToStr(getOwnerWindow));
189 LogEvent(LogStartup, ' windowTitle: ' + getWindowTitle);
190
191 if nil <> nhmDebugMessages then
192 begin
193 LogEvent(LogStartup, '');
194 LogEvent(LogStartup, '---- NHM DebugMessages ----');
195 for i := 0 to nhmDebugMessages.count-1 do
196 begin
197 LogEvent(LogStartup, ' ' + nhmDebugMessages[i]);
198 end;
199 end;
200
201 end;
202
203
204 Function TCmdLineParameters.setHelpManagerFlag(const aNewValue : boolean) : boolean;
205 begin
206 helpManagerFlag := aNewValue;
207 result := helpManagerFlag;
208 end;
209
210
211 Procedure TCmdLineParameters.parseCmdLine(const aCmdLineString : AnsiString);
212 var
213 tmpState : (WHITESPACE, QUOTE, SWITCH, FILENAME, TEXT);
214 tmpCurrentParsePosition : integer;
215 tmpQuoted : boolean;
216 tmpCurrentChar : char;
217 tmpWhitespace : AnsiString;
218 tmpQuote : AnsiString;
219 tmpSwitch : AnsiString;
220 tmpEnvDebug : String;
221 begin
222 // first adjust logging
223 debugEnabled := false;
224 tmpEnvDebug := GetEnv(ENV_DEBUG);
225
226 if tmpEnvDebug <> '' then
227 begin
228 debugEnabled := true;
229 SetLogAspects(tmpEnvDebug);
230 end;
231
232 LogEvent(LogStartup, 'ParseCommandLine: "' + aCmdLineString + '"');
233
234 // store the original string for debugging
235 commandLine := aCmdLineString;
236
237 // reset the whole object
238 showUsageFlag := false;
239 searchFlag := false;
240 globalSearchFlag := false;
241 language := '';
242 showIndexFlag := false;
243 helpManagerFlag := false;
244 helpManagerWindow := 0;
245 windowPositionFlag := false;
246 ownerWindow := 0;
247 windowTitle := '';
248 parsedSearchText := '';
249 parsedFileNames := '';
250 parsedRawFileNames := '';
251
252 try
253 // start parsing
254 tmpState := WHITESPACE;
255 tmpWhitespace := '';
256 tmpSwitch := '';
257 tmpQuote := '';
258 tmpQuoted := false;
259 tmpCurrentParsePosition := 1;
260 while tmpCurrentParsePosition <= length(aCmdLineString) do
261 begin
262 tmpCurrentChar := aCmdLineString[tmpCurrentParsePosition];
263
264 Case tmpCurrentChar of
265 ' ' :
266 begin
267 Case tmpState of
268
269 WHITESPACE :
270 begin
271 tmpWhitespace := tmpWhitespace + tmpCurrentChar;
272 end;
273
274 QUOTE :
275 begin
276 tmpQuote := tmpQuote + tmpCurrentChar;
277 end;
278
279 SWITCH :
280 begin
281 if tmpQuoted then
282 begin
283 tmpSwitch := tmpSwitch + tmpCurrentChar;
284 end
285 else
286 begin
287 parseSwitch(tmpSwitch);
288 tmpState := WHITESPACE;
289 tmpWhitespace := tmpCurrentChar;
290 end
291 end;
292
293 FILENAME :
294 begin
295 if tmpQuoted then
296 begin
297 parsedFileNames := parsedFileNames + tmpCurrentChar;
298 parsedRawFileNames := parsedRawFileNames + tmpCurrentChar;
299 end
300 else
301 begin
302 tmpState := WHITESPACE;
303 tmpWhitespace := tmpCurrentChar;
304 end
305 end;
306
307 TEXT :
308 begin
309 if tmpQuoted then
310 begin
311 parsedSearchText := parsedSearchText + tmpCurrentChar;
312 end
313 else
314 begin
315 tmpState := WHITESPACE;
316 tmpWhitespace := tmpCurrentChar;
317 end
318 end;
319 end;
320 end;
321
322 '/', '-' :
323 begin
324 Case tmpState of
325 WHITESPACE :
326 begin
327 tmpState := SWITCH;
328 tmpSwitch := '';
329 end;
330
331 QUOTE :
332 begin
333 tmpState := SWITCH;
334 tmpSwitch := '';
335 end;
336
337 SWITCH :
338 begin
339 parseSwitch(tmpSwitch);
340 tmpSwitch := '';
341 end;
342
343 FILENAME :
344 begin
345 parsedFileNames := parsedFileNames + tmpCurrentChar;
346 parsedRawFileNames := parsedRawFileNames + tmpCurrentChar;
347 end;
348
349 TEXT :
350 begin
351 parsedSearchText := parsedSearchText + tmpCurrentChar;
352 end;
353 end;
354 end;
355
356 '"' :
357 begin
358 if tmpQuoted then
359 begin
360 tmpQuoted := false;
361 Case tmpState of
362 FILENAME :
363 begin
364 parsedRawFileNames := parsedRawFileNames + tmpCurrentChar;
365 end;
366 TEXT :
367 begin
368 parsedSearchText := parsedSearchText + tmpCurrentChar;
369 end;
370 end;
371 end
372 else
373 begin
374 tmpQuoted := true;
375 Case tmpState of
376 WHITESPACE :
377 begin
378 tmpState := QUOTE;
379 tmpQuote := tmpCurrentChar;
380 end;
381 FILENAME :
382 begin
383 parsedRawFileNames := parsedRawFileNames + tmpCurrentChar;
384 end;
385 end;
386 end;
387 end;
388
389 // any other char
390 else
391 begin
392 Case tmpState of
393
394 WHITESPACE :
395 begin
396 if length(parsedFileNames) > 0 then
397 begin
398 tmpState := TEXT;
399 parsedSearchText := parsedSearchText + tmpWhitespace + tmpCurrentChar;
400 end
401 else
402 begin
403 tmpState := FILENAME;
404 parsedFileNames := parsedFileNames + tmpCurrentChar;
405 parsedRawFileNames := parsedRawFileNames + tmpCurrentChar;
406 end;
407 end;
408
409 QUOTE :
410 begin
411 if length(parsedFileNames) > 0 then
412 begin
413 tmpState := TEXT;
414 parsedSearchText := parsedSearchText + tmpQuote + tmpCurrentChar;
415 end
416 else
417 begin
418 tmpState := FILENAME;
419 parsedFileNames := parsedFileNames + tmpCurrentChar;
420 parsedRawFileNames := parsedRawFileNames + tmpQuote + tmpCurrentChar;
421 end;
422 end;
423
424 SWITCH :
425 begin
426 tmpSwitch := tmpSwitch + tmpCurrentChar;
427 end;
428
429 FILENAME :
430 begin
431 parsedFileNames := parsedFileNames + tmpCurrentChar;
432 parsedRawFileNames := parsedRawFileNames + tmpCurrentChar;
433 end;
434
435 TEXT :
436 begin
437 parsedSearchText := parsedSearchText + tmpCurrentChar;
438 end;
439 end;
440 end;
441 end;
442 inc(tmpCurrentParsePosition);
443 end;
444
445 // ok all chars are processed, but maybe we have something to do
446 Case tmpState of
447 SWITCH :
448 begin
449 parseSwitch(tmpSwitch);
450 end;
451 end;
452 except
453 on e:EParsingFailed do
454 begin
455 showUsageFlag := true;
456 end;
457 end;
458
459 // remove blanks
460 fileNames := AnsiStrTrim(getParsedFileNames);
461 searchText := AnsiStrTrim(getParsedSearchText);
462
463 if getGlobalSearchFlag
464 AND (getParsedSearchText = '')
465 then
466 begin
467 fileNames := '';
468 searchText := parsedRawFileNames;
469 end;
470
471 // to be compatible with the old one we have to ignore
472 // the quotes
473 if not getGlobalSearchFlag
474 AND (not getSearchFlag)
475 then
476 begin
477 searchText := AnsiStrTrimChars(searchText, ['"']);
478 end;
479
480 LogEvent(LogStartup, 'Parameters parsed');
481 LogDetails;
482 end;
483
484
485 Function TCmdLineParameters.handleSwitchWithValue(const aSwitchString : String; const aSwitch : String; var aValue : String) : Boolean;
486 var
487 tmpText : String;
488 tmpValueStartPos : integer;
489 tmpSwitchLength : integer;
490 begin
491 tmpSwitchLength := Length(aSwitch);
492 tmpText := copy(aSwitchString, 1, tmpSwitchLength);
493 tmpText := lowercase(tmpText);
494
495 if (lowercase(aSwitch) = tmpText) then
496 begin
497 tmpValueStartPos := tmpSwitchLength;
498 inc(tmpValueStartPos);
499 if aSwitchString[tmpValueStartPos] = ':' then
500 begin
501 inc(tmpValueStartPos);
502 end;
503
504 aValue := copy(aSwitchString, tmpValueStartPos, Length(aSwitchString) - tmpValueStartPos+ 1);
505 result := true;
506 exit;
507 end;
508 result := false;
509 end;
510
511
512 Function ParseWindowPositionPart(const aPart: String; const aScreenDimension: longint): longint;
513 Var
514 tmpPart : String;
515 Begin
516 if aPart = '' then
517 raise EParsingFailed.Create('Missing position element');
518
519 if StrEndsWithIgnoringCase(aPart, 'P') then
520 begin
521 tmpPart := copy(aPart, 1, length(aPart)-1);
522 if tmpPart = '' then
523 raise EParsingFailed.Create('Missing position element');
524
525 Result := StrToInt(tmpPart);
526 if Result < 0 then
527 Result := 0;
528 if Result > 100 then
529 Result := 100;
530 Result := Round(Result / 100 * aScreenDimension);
531 end
532 else
533 begin
534 Result := StrToInt(aPart);
535 end;
536 end;
537
538 Function ParseWindowPosition(const aParamValue: String): TWindowPosition;
539 Var
540 tmpParts : TStringList;
541 tmpScreenWidth : longint;
542 tmpScreenHeight : longint;
543 Begin
544 tmpParts := TStringList.Create;
545 StrExtractStrings(tmpParts, aParamValue, [','], '\');
546
547 tmpScreenWidth := WinQuerySysValue(HWND_DESKTOP, SV_CXSCREEN);
548 tmpScreenHeight := WinQuerySysValue(HWND_DESKTOP, SV_CYSCREEN);
549
550 result.Left := ParseWindowPositionPart(tmpParts[0], tmpScreenWidth);
551 result.Bottom := ParseWindowPositionPart(tmpParts[1], tmpScreenHeight);
552
553 result.Width := ParseWindowPositionPart(tmpParts[2], tmpScreenWidth);
554 if result.Width < 50 then
555 result.Width := 50;
556
557 result.Height := ParseWindowPositionPart(tmpParts[3], tmpScreenHeight);
558 if result.Height < 50 then
559 result.Height := 50;
560
561 tmpParts.Destroy;
562 end;
563
564
565 Procedure TCmdLineParameters.parseSwitch(const aSwitchString : String);
566 var
567 tmpCurrentChar : char;
568 tmpValue : String;
569 begin
570 // lang
571 if handleSwitchWithValue(aSwitchString, 'lang', tmpValue) then
572 begin
573 language := tmpValue;
574 exit;
575 end;
576
577 // title
578 if handleSwitchWithValue(aSwitchString, 'title', tmpValue) then
579 begin
580 windowTitle := tmpValue;
581 exit;
582 end;
583
584 // HM
585 if handleSwitchWithValue(aSwitchString, 'hm', tmpValue) then
586 begin
587 try
588 helpManagerWindow := StrToInt(tmpValue);
589 helpManagerFlag := true;
590 except
591 on e:Exception do
592 begin
593 showUsageFlag := true;
594 end;
595 end;
596 exit;
597 end;
598
599 // owner
600 if handleSwitchWithValue(aSwitchString, 'owner', tmpValue) then
601 begin
602 try
603 ownerWindow := StrToInt(tmpValue);
604 except
605 on e:Exception do
606 begin
607 showUsageFlag := true;
608 end;
609 end;
610 exit;
611 end;
612
613 // pos
614 if handleSwitchWithValue(aSwitchString, 'pos', tmpValue) then
615 begin
616 windowPosition := ParseWindowPosition(tmpValue);
617 windowPositionFlag := true;
618 exit;
619 end;
620
621 // check the next char
622 // TODO check for other invalid chars
623 tmpCurrentChar := aSwitchString[1];
624 Case tmpCurrentChar of
625 'h', 'H', '?' :
626 begin
627 showUsageFlag := true;
628 end;
629
630 's', 'S' :
631 begin
632 searchFlag := true;
633 end;
634
635 'i', 'I' :
636 begin
637 showIndexFlag := true;
638 end;
639
640 'g', 'G' :
641 begin
642 globalSearchFlag := true;
643 end;
644
645 else
646 begin
647 raise EParsingFailed.Create('Unsupported switch');
648 end;
649 end;
650 end;
651
652
653 FUNCTION TCmdLineParameters.getFileNames(const aShowNewViewHelpIfNoFileSpecifiedFlag : Boolean) : AnsiString;
654 var
655 tmpOwnHelpFileName : String;
656 begin
657 // user hasn't requested any particular file
658 // at startup, so if the option is set,
659 // load the NewView help file
660 if aShowNewViewHelpIfNoFileSpecifiedFlag
661 AND (fileNames = '')
662 AND not getGlobalSearchFlag then
663 begin
664 tmpOwnHelpFileName := getOwnHelpFileName;
665 if FileExists(tmpOwnHelpFileName) then
666 begin
667 result := tmpOwnHelpFileName;
668 end;
669 end
670 else
671 begin
672 result := fileNames;
673 end;
674 end;
675
676
677 FUNCTION TCmdLineParameters.getOwnHelpFileName: String;
678 var
679 tmpLanguage : String;
680 begin
681 tmpLanguage := getLanguage;
682 if tmpLanguage = '' then
683 begin
684 tmpLanguage := GetEnv(LanguageEnvironmentVar)
685 end;
686
687 result := FindDefaultLanguageHelpFile('NewView', tmpLanguage);
688 end;
689
690
691 PROCEDURE TCmdLineParameters.addNhmDebugMessage(const aString : String);
692 begin
693 if nil = nhmDebugMessages then
694 begin
695 nhmDebugMessages := TStringList.Create;
696 end;
697
698 nhmDebugMessages.add(aString);
699 end;
700
701
702 PROCEDURE ParseAndExpandFileNames(const aFileNameString : String; aResult: TStrings);
703 var
704 i : longint;
705 tmpFileNamesList: TStringList;
706 tmpItem: String;
707 tmpEnvironmentVarValue: string;
708 begin
709 LogEvent(LogDebug, 'ParseAndExpandFileNames "' + aFileNameString + '"');
710
711 tmpFileNamesList := TStringList.Create;
712
713 StrExtractStrings(tmpFileNamesList, aFileNameString, [HELP_FILE_DELIMITER, PATH_SEPARATOR], #0);
714 for i := 0 to tmpFileNamesList.Count - 1 do
715 begin
716 tmpItem := tmpFileNamesList[i];
717
718 // is this a environment var
719 tmpEnvironmentVarValue := GetEnv(tmpItem);
720 if DosError = 0 then
721 begin
722 // environment var exists
723 LogEvent(LogStartup, ' Environment var found; translated to: "' + tmpEnvironmentVarValue + '"');
724 ParseAndExpandFileNames(tmpEnvironmentVarValue, aResult);
725 end
726 else if DirectoryExists(tmpItem) then
727 begin
728 ListFilesInDirectory(tmpItem, '*' + HELP_FILE_EXTENSION, true, aResult);
729 end
730 else
731 begin
732 aResult.Add(tmpItem);
733 end;
734 end;
735
736 tmpFileNamesList.Destroy;
737 end;
738
739
740 FUNCTION nativeOS2GetCmdLineParameter : AnsiString;
741 VAR
742 tmpPtib : PTIB; // thread information block
743 tmpPpib : PPIB; // process information block
744 tmpCmd : PCHAR;
745 tmpParams : PCHAR;
746
747 BEGIN
748 // ask the system
749 DosGetInfoBlocks(tmpPtib, tmpPpib);
750 tmpCmd := tmpPpib^.pib_pchcmd;
751 // the fist element (null terminated) is the
752 // called command itself
753 // skip to the next null terminated string
754 // these are the parameters
755 tmpParams := tmpCmd + StrLen(tmpCmd) + 1;
756
757 result := '';
758 AnsiSetString(result, tmpParams, StrLen(tmpParams));
759 END;
760
761
762END.
Note: See TracBrowser for help on using the repository browser.