Browse Source

* Allow to specify a number of messages to send

git-svn-id: trunk@33703 -
michael 9 years ago
parent
commit
d2ce69a98c
1 changed files with 9 additions and 2 deletions
  1. 9 2
      packages/fcl-process/examples/ipcclient.pp

+ 9 - 2
packages/fcl-process/examples/ipcclient.pp

@@ -2,16 +2,23 @@
 {$h+}
 program ipcclient;
 
-uses simpleipc;
+uses sysutils,simpleipc;
+
+Var
+  I,Count : Integer;
 
 begin
+  Count:=1;
   With TSimpleIPCClient.Create(Nil) do
     try
       ServerID:='ipcserver';
       If (ParamCount>0) then
         ServerInstance:=Paramstr(1);
+      if ParamCount>1 then
+        Count:=StrToIntDef(ParamStr(2),1);  
       Active:=True;
-      SendStringMessage('Testmessage from client');
+      for I:=1 to Count do
+        SendStringMessage(Format('Testmessage %d from client',[i]));
       Active:=False;
     finally
       Free;