Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Passing Parameters

3 views
Skip to first unread message

Geoff

unread,
Dec 27, 2002, 9:18:06 AM12/27/02
to
> I am looking for how to pass a parameter to a compiled Delphi routine
> similar to
> PRJTEST.EXE PARAM1 PARAM2

Hi Ron!

I'm not too sure if it helps or not, but I use the following routine to run
an exe program that takes 2 parameters. Feel free to hack it if its what
you need (this runs ok on NT systems - dont know about 95 OS's though).
Note that this launches the AILINK program - its not run in the background.

Regards,
Geoff.


procedure TLeases.SpeedButton17Click(Sender: TObject);
var st:array[0..100] of char;
p:pchar;
i,n:integer;
begin
if not fileExists('C:\Program Files\Ausinfo\AILINK.exe') then
begin
showMessage('Your PC is not setup for AusInfo - see IT fast...')
end else
begin
st:='C:\Program Files\Ausinfo\AILINK MAPINFO ';
n:=length('C:\Program Files\Ausinfo\AILINK MAPINFO ')-1;
for i:=1 to length(serviceNumber) do
st[n+i]:=serviceNumber[i];
p:=st;
winExec(p,sw_showNormal)
end
end;


Ron Dolce

unread,
Dec 27, 2002, 9:55:34 AM12/27/02
to
Looking over your example, it looks like it is run from inside another
program. Not quite what I am looking for.
I am running PRJTEST.EXE as an external program at the operating system
level and wanting to pass paramaters to it from an access program that
is well established at the client site. I could break down and learn VB
Script and write within access but I am trying to move them slowly away
from access to FF. I am about 50% there but with some lingering
functions still in access, so I am using the few remaining routines as a
front end to FF. The parameters are to calculate a charge based on
preset values stored on the FF side and write them to a field on the
access side. I have it working without passing parameters but running
into a record locking problem when more than one person is entering data
so passing a parameter seems like an easy method to eliminate the
locking problem. Currently storing the value of the parameter in an
single record access file but this is what causing the lock problem with
2 or more entry people.

Ron

John Hay

unread,
Dec 27, 2002, 9:07:37 AM12/27/02
to
Ron

> My case I am trying to run a ff routine from outside of FF from another
> source.

If you are trying to see what parameters were passed look at paramcount and
paramstr.

John


David Marcus

unread,
Dec 27, 2002, 2:08:25 PM12/27/02
to
Ron Dolce wrote:
> Inside = called from another delphi program
>
> outside = run at the operating system level
>
> I am looking to run at operating system or using the "RUNAPP" command
> from Access and from there to pass parameters.

So, the problem is not how to pass the parameters, but how to access
them from inside your Delphi program? If so, John Hay's suggestion to
look at paramcount and paramstr is correct.

--
David Marcus

Ron Dolce

unread,
Dec 26, 2002, 2:35:04 PM12/26/02
to
D6 SP2 FF2.12 O4.5

I am looking for how to pass a parameter to a compiled Delphi routine
similar to
PRJTEST.EXE PARAM1 PARAM2

I am trying to run a background process that updates a table when you
perform certain inputs to a main table.

Help or pointing in the right direction would be appreciated.

Ron Dolce
Quantum Business Computers

David Guest

unread,
Dec 26, 2002, 3:32:02 PM12/26/02
to
Systools has a Spawn component which allows you to start another process
with parameters ...

And you should be able to do it with ShellExecute ... you should be able
to find info on that in the Windows Api ..

David Marcus

unread,
Dec 27, 2002, 11:17:26 AM12/27/02
to
Ron Dolce wrote:
> Looking over your example, it looks like it is run from inside another
> program.

What do you mean by "inside" and "outside"?

--
David Marcus

0 new messages