Re: Mystic Program Question

[email protected] (g00r00)
Newsgroups alt.bbs.mystic
Organization Agency HUB, Dunedin - New Zealand | bbs.nz/#Fidonet
Message-ID <[email protected]>
 MF> I did attempt to write this to a file using appendtext and when I did it
 MF> this way, the information contained in the bat file was also cut off. It
 MF> wasn't passing all the information. Seemed like a limit there too....

Yep AppendText would have the same limit.  Strings in MPL are limited to 255 
characters everywhere.

To do it in MPL you have to break it up into small chunks and then write it to 
the file.  Here is a quick example I whipped up for you (you could also check 
the OSID function and make it create a .sh in Unix and .bat in Windows):

Uses CFG

Var
  F         : File;
  Cmd1      : String;
  Cmd2      : String;
  Cmd3      : String;
  BatchName : String;
Begin
  Cmd1 := 'REM This is the first part of a long command. ';
  Cmd2 := 'And this is part two of a long commmand. ';
  Cmd3 := 'And this is part three of a long command';

  Write   ('Command line: ');
  Write   (Cmd1)
  Write   (Cmd2)
  WriteLn (Cmd3)

  fAssign   (F, CfgTempPath + 'mybat.bat', 66);
  fReWrite  (F);
  fWriteStr (F, Cmd1);
  fWriteStr (F, Cmd2);
  fWriteLn  (F, Cmd3);
  fClose    (F);

  WriteLn ('Batch file created. Press any key to execute and delete: |PN');
  
  MenuCmd('DD', CfgTempPath + 'mybat.bat');

  FileErase (CfgTempPath + 'mybat.bat');
End.

... The dog ate my .REP packet
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.