Parsing info from ini file into command line for a delphi exe

Giganews Newsgroups
Subject:Parsing info from ini file into command line for a delphi exe
Posted by: Richard Caruana
Date:Sat, 27 Feb 2010

I want an exe file made using delphi 2010.

to do
1) what this bat file can do and more by doing the following
2) to goto [user-01] section in the ini file and copying the patient number (this is a variable or string whatever is most convenient..., as you will have a new patient number every time you access a different patient)

then using that patient number goto the [PatientList-01] section of the same ini file and copy the corrsponding surname and first name without the title (eg without Mr or Mrs or Dr , master, miss, etc)

then parse all this info into

C:\CSNImage\TW.EXE “-PC:\Images\009158-NPiet Reel”

which would mean that
But first you would need to collect the strings
Str1= "009158"
Str2="Piet"
Str3="Reel"

Something like..
C:\CSNImage\TW.EXE Str(“-PC:\Images\")+str(str3)+str("-N")+str(str1)+" "+Str(str2)

then get this to execute as a command line like the bat file above eg
C:\CSNImage\TW.EXE “-PC:\Images\009158-NPiet Reel”

it assumes the executable is already in the correct folder.

Does anyone know if there are any examples of how to run a bat file from inside a delphi 2010 executable ?

I have an ini file ... owl.ini
which looks like..
..........................................................................
[PatientList-01]
1=005987 Smith,Mr Desmond
2=005901 West,Mr Denis
3=003199 East,Mrs Lynette
4=009981 Street,Miss Renee
5=009947 Boot,Mr Anthony
6=009158 Reel,Mr Piet
7=
8=
9=

[User-01]
Account=009151
Patient=009158
...........................................................................

The result I would like to achieve is to have an exe file which can do the same job as this Bat file.

If I run piet.bat file with the following-
C:\CSNImage\TW.EXE “-PC:\Images\009158-NPiet Reel”
this command then launches a third party app but with details from the main client program.

THE TRICK IS THOUGH THAT I WISH TO FORCE THE COMMAND LINE TO CHOOSE THE CURRENT PATIENT SHOWN IN SECTION...

[User-01]
Patient=009158

WHERE OBVIOUSLY THE PATIENT NUMBER CAN CHANGE.

where
1) -P is a parameter for where to store images EG C:\Images\009158
2) -N is a parameter for Name of client eg Piet Reel

MY PARENT APPLICATION WILL ONLY LAUNCH AN EXE FILE

BUT THE THIRD PARTY APP EXPECTS A COMMAND LINE

If someone comes up with an answer that works ( meaning it does what I have asked) using Delphi 2010 where I have full rights to the source code
I will pay one person only $50 USD via PAYPAL only.

kind regards

Richard Caruana

Replies