🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.pascal.borland
3 messages
3 total messages Started by Andy Mon, 28 Jan 2002 14:32
paramstr longer than 127 characters. Is it possible?
#139
Author: Andy
Date: Mon, 28 Jan 2002 14:32
19 lines
1713 bytes
Hello,

I write a program, which must works in batch mode - user select some files 
in explorer, drag'em to the program and program starts to calculate every 
separate input. Code looks like below:

...   
for i :=1 to ParamCount do
    	begin
    	execute program for paramstr(i);
    	end;
...

This works OK untill paramstr is not longer that 127 characters. Same code 
compilled with free pascal seems has two times longer limit.
Is there a way to process any number of input files, without limits?

Thanks,
Andy
Re: paramstr longer than 127 characters. Is it possible?
#140
Author: Wolfgang Ehrhardt
Date: Mon, 28 Jan 2002 21:15
57 lines
2971 bytes
On Mon, 28 Jan 2002 14:32:20 +0000 (UTC), andrew@SPAMNOyahoo.com
(Andy) wrote:

>Hello,
>
>I write a program, which must works in batch mode - user select some files 
>in explorer, drag'em to the program and program starts to calculate every 
>separate input. Code looks like below:
>
>...   
>for i :=1 to ParamCount do
>    	begin
>    	execute program for paramstr(i);
>    	end;
>...
>
>This works OK untill paramstr is not longer that 127 characters. Same code 
>compilled with free pascal seems has two times longer limit.
>Is there a way to process any number of input files, without limits?
>
>Thanks,
>Andy

If you are working under WIN98 (other WIN version may also work) you
can use the environment variable CMDLINE:

example:

uses dos;
begin
  writeln('Command line: ', GetEnv('CMDLINE'));
end.

In the following screen output, cl is called from a bat file:

C:\TMP>cl
1234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890
12345678912345678900
Command line:cl 123456789012345678901234567890123456789012345678901234
5678901234567890123456789012345678901234567890123456789012345678901234
5678901234567890123456789012345678901234567890123456789012345678901234
5678901234567890123456789012345678901234567890123456789012

As you see then full 255 Bytes of a string are used, if you write a
pChar-GetEnv you should get the whole command line.

You should do some processing, because for example WIN file name from
the explorer can contain spaces and may be enclosed in ".

Wolfgang

-- 
In order to e-mail me a reply to this message, you will have 
to remove PLEASE.REMOVE from the address shown in the header.
Re: paramstr longer than 127 characters. Is it possible?
#141
Author: Dr John Stockton
Date: Mon, 28 Jan 2002 22:05
41 lines
3108 bytes
JRS:  In article <91A4ABE38qwerty@193.193.193.102>, seen in news:comp.la
ng.pascal.borland,comp.lang.pascal.misc,borland.public.turbopascal, Andy
<andrew@SPAMNOyahoo.com> wrote at Mon, 28 Jan 2002 14:32:20 :-
>Hello,
>
>I write a program, which must works in batch mode - user select some files 
>in explorer, drag'em to the program and program starts to calculate every 
>separate input. Code looks like below:
>
>...   
>for i :=1 to ParamCount do
>       begin
>       execute program for paramstr(i);
>       end;
>...
>
>This works OK untill paramstr is not longer that 127 characters. Same code 
>compilled with free pascal seems has two times longer limit.
>Is there a way to process any number of input files, without limits?

Borland newsgroups dislike crossposting - see sig below.

Borland newsgroups have their own proper server - see sig below - the
Borland experts will not see your post; nor this one.

This seems off-topic for at least one of c.l.p.borland & c.l.p.misc; did
you not read the regular informative posts?


AIUI, the parameter list is transferred in the upper half of the
256-byte PSP, at least for 16-bit programs such as TP/BP generate.  Not,
of course, that you have actually said which Pascal you are trying.

I would code such that if a parameter starts with '@', the rest of it is
the name of a file from which further parameters are now read.
 
-- 
� John Stockton, Surrey, UK.  jrs@merlyn.demon.co.uk   Turnpike v4.00   MIME. �
 Web <URL: http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
 For news:borland.*, use their server newsgroups.borland.com ; but first read 
 Guidelines <URL:http://www.borland.com/newsgroups/guide.html> very carefully.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads