Re: Mystic Program Question

[email protected] (g00r00)
Newsgroups alt.bbs.mystic
Organization Agency HUB, Dunedin - New Zealand | bbs.nz/#Fidonet
Message-ID <[email protected]>
Here is a cleaner example of executing a command line up to 1000 characters if 
you split it into 4 chunks of 255:

Uses CFG

Function LargeCommand (Name: String; C1, C2, C3, C4: String) : String;
Var
  F : File;
Begin
  If OSType = 0 or OSType = 4 Then  // Windows or OS/2
    Name := Name + '.bat'
  Else
    Name := Name + '.sh';
    
  fAssign   (F, CfgTempPath + Name, 66);
  fReWrite  (F);
  fWriteStr (F, C1);
  fWriteStr (F, C2);
  fWriteStr (F, C3);
  fWriteLn  (F, C4);
  fClose    (F);

  LargeCommand := CfgTempPath + Name;
End;

Var
  Command : String;
Begin

  Command := LargeCommand(
    'mybatch',                       // Filename (.bat or .sh will be added)
    'Large command line part 1',     // Part 1 of long command
    'Large command line part 2',     // Part 2 of long command
    '',                              // Part 3 of long command
    ''                               // Part 4 of long command
  );

  // Large command returns the path and filename of the batch file so we can
  // take that and execute then delete it:

  //MenuCmd   ('DD', Command);
  //FileErase (Command);
End.

... A book misplaced is a book lost
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.