FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Local INI file
Posts: 208
Joined: Wed Dec 03, 2008 04:48 PM
Local INI file
Posted: Sun Nov 03, 2013 04:21 PM
I have this situation:

The program and DBFs are installed on the SERVER
On each WS I have a mapped drive F which points to the servers drive where the program is installed
On the each WS desktop I have the shortcut which points to F\clock\program.exe, therefore on WS there is no Program.EXE and no related DBF at all.

Now I need the possibility to define the printers which each WS uses. This settings will be written in CLOCK.INI file but on WS MACHINE! So when the user runs the program and menu option to setup the printers for use, actually the LOCAL CLOCK.INI should be loaded and read. After the user confirms, the LOCAL INI file shoul be saved on WS machine somewhere.

This way whenever each WS user prints something the printout will go on the printer attached to each particular WS
One WS can have HP printer attached, other WS can have Samsung printer attached and so forth.

My problem is how to load and write the INI file which resides LOCAL machine, on each particular WS? I don't want to load the CLOCK.INI on SERVER, because then all WS would try to print on the printer which they do not have attached.

I know I saw somewhere the solution for this, bu am in big hurry and cannot remember where.
Thanks
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Local INI file
Posted: Sun Nov 03, 2013 06:02 PM

Boris,

you can put the INI file in a folder inside the WS temp directory.

EMG

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Local INI file
Posted: Sun Nov 03, 2013 06:06 PM

You can create a section in the CLOCK.INI with the name of each user and put your printer in this section

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 208
Joined: Wed Dec 03, 2008 04:48 PM
Re: Local INI file
Posted: Sun Nov 03, 2013 08:14 PM
Enrico,

When I run CLOCK.EXE on server, at the program beginning I have
SET DEFAULT TO csomePath
SET PATH TO cSomePAth

Whenever I USE some DBF it searches first in \cSomePath and that's ok

When I use low level functions, the files will be deleted or created in the folder where the CLOCK.EXE resides. If I want some specific file to handle I must put a prefix which denotes the folder:
If I use
INI oIni "CLOCK.INI"
it will use clock.ini in the folder where CLOCK.EXE is running, meaning - on server.

If I want some other INI file I do:
INI oIni (cSomePath + "\CLOCK.INI")

Now, how can I instruct the program to open each WS "CLOCK.INI" so each WS can use it own printers
As you said:
"you can put the INI file in a folder inside the WS temp directory."
How can I do that?

Thanks

@cnavarro
Yes, this is the idea I had but not the user, I need a WS name to store into the INI file section for each WS
On each WS severeal different users might log in
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Local INI file
Posted: Sun Nov 03, 2013 09:30 PM

Boris,

who is that runs CLOCK.EXE? I assumed that CLOCK.EXE is run by each WS, is it true? If yes, each WS can access its own INI file. If no, you have a problem. If CLOCK.EXE is run by the server, you had to share each WS drive so the server can access each WS INI file.

EMG

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Local INI file
Posted: Sun Nov 03, 2013 09:43 PM

Boris
And Section?
GetEnv( "COMPUTERNAME" ) + "_" + GetEnv( "USERNAME" )

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 208
Joined: Wed Dec 03, 2008 04:48 PM
Re: Local INI file
Posted: Sun Nov 03, 2013 10:01 PM

Enrico,

Yes, the CLOCK.EXE is on SERVER and each WS can run this program.

When I define the printers for from each WS the function
GetPvProfString( 'Printers', 'Regular', '', 'pay.ini' )
tries to read the printers from PAY.INI file in \WINDOWS folder

If the PAY.INI is not found (like the first time we run program from some WS) the program offers all installed printers on WS
We select one and write PAY.INI
And here I have a problem.
When I write PAY.INI this file is written on SERVER on folder \CLOCK where the CLOCK.EXE resides...
I want the PAY.INI to be written on some folder on the WS which called the program instead on SERVER

Posts: 208
Joined: Wed Dec 03, 2008 04:48 PM
Re: Local INI file
Posted: Sun Nov 03, 2013 10:04 PM

@cnavarro
yes, I can use this if I decide to have all user printers in that PAY.INI file on SERVER
Thanks

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Local INI file
Posted: Sun Nov 03, 2013 11:03 PM
Boris,

codemaker wrote:Enrico,

Yes, the CLOCK.EXE is on SERVER and each WS can run this program.

When I define the printers for from each WS the function
GetPvProfString( 'Printers', 'Regular', '', 'pay.ini' )
tries to read the printers from PAY.INI file in \WINDOWS folder

If the PAY.INI is not found (like the first time we run program from some WS) the program offers all installed printers on WS
We select one and write PAY.INI
And here I have a problem.
When I write PAY.INI this file is written on SERVER on folder \CLOCK where the CLOCK.EXE resides...
I want the PAY.INI to be written on some folder on the WS which called the program instead on SERVER


Just use the right path (ie. c:\myfolder\pay.ini).

EMG
Posts: 208
Joined: Wed Dec 03, 2008 04:48 PM
Re: Local INI file
Posted: Mon Nov 04, 2013 12:46 AM

Ok Enrico, thanks, will try it tomorrow.

Continue the discussion