I'm in the process of creating a program and the following works perfect under linux but under windows it cuts out the length of the command.
I basically have menucmd('DD','command ' + var + var1 + var2 +var3 + 'something ' + var4 + '')
There shouldn't be any difference between Linux and Windows. I am assuming this is MPL? Are you talking about the MIDE editor or where
are you seeing this?
The easiest way to probably recreate this is to create a MPL with a menucmd('DD', 'input a very long line') and run that from windows and
then from linux. Watch the logs and you will see that it gets cut short
on the windows end.
Seems ok to me in Windows. The text I did is probably about 150 characters long and it seems to be executing fine. Do you have any
other ideas on how I could reproduce the problem?
Unless I'm pushing over 200 characters under windows not realizing. The command is slightely different.
Is there anyway to get this character limit increased? I can then test
on my end?
The menu editor is limited to 250 characters now (up from 200) for the optional data field. In MPL there is a hard limitation of 255
characters which is an MPL limitation on all OSes that I cannot easily extend.
I did attempt to write this to a file using appendtext and when I did it this way, the information contained in the bat file was also cut off. It wasn't passing all the information. Seemed like a limit there too....
I did attempt to write this to a file using appendtext and when I did this way, the information contained in the bat file was also cut off. 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.
I did attempt to write this to a file using appendtext and when I did this way, the information contained in the bat file was also cut off. 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.
Sysop: | digital man |
---|---|
Location: | Riverside County, California |
Users: | 1,041 |
Nodes: | 17 (1 / 16) |
Uptime: | 07:14:09 |
Calls: | 501,708 |
Calls today: | 1 |
Files: | 104,420 |
D/L today: |
126 files (8,849K bytes) |
Messages: | 298,335 |
Posted today: | 2 |