creating a config file. how to read and use the info

ds1718

Client
Регистрация
25.11.2011
Сообщения
33
Благодарностей
4
Баллы
0
I have about 10 variable that have to change in a template for the template to work for my next customer.

So instead of editing the template in 10 location I am trying to create a config script that sets all the variable for the template. So the only change is the the location of the config file.

I have functional test working. But I can not get this last part to wrok correctly.

Simple Config file is as follows

File Location#c:/scripts/customer/cust1.txt
Wait time low#300
Wait Time High#600

I read the config as a block.
I then parse the block with three macros

each parses following the # sign to get that line number.

Each returns the correct line front the file when run in debugger.

The problem is when I try to read a line from the text file on line 1.

Debugger waits about 2minutes, and the returns an error that text file is locked

I am using the following macro to read it

{-File.GetString-|-{-FieldData.FieldData-|-●8●8●6●4●6●6●-|-≡1≡8≡1≡4≡7≡4≡3≡9≡7≡2≡-}-|-0-|-false-}

Were the Field data is the result of the reg ex that grabs the text file.

If I replace the Field data portion with the location it works fine. When I try to input the text file location with the variable it crashes..

Can any body point me in the right direction?

My random numbers work fine from the high low variable.


Thanks
DS
 

Hungry Bulldozer

Moderator
Регистрация
12.01.2011
Сообщения
3 441
Благодарностей
834
Баллы
113
Probably it happens because file is already held for reading and locked, so here is a deadlock. It would be easier to get by looking on the template.
 

ds1718

Client
Регистрация
25.11.2011
Сообщения
33
Благодарностей
4
Баллы
0
not locked

The file is not locked, if i create a get string with the exact same file path manually it works fine.

What is the easiest way to set a file location?

I have to create 30 different templates, all that run from a different file. that is the only change made to each template. is there a way to read a file, and then launch the template 1 time for each line in the file reading the specified file?

Probably it happens because file is already held for reading and locked, so here is a deadlock. It would be easier to get by looking on the template.
 

Stereomike

Client
Регистрация
29.03.2011
Сообщения
221
Благодарностей
30
Баллы
0
make kinda source folder, store the untouched file there (1 line for 1 template)
let every instance grab line 0 (and del that line)
now every instance does something different
if the file is empty, copy it from source folder back into your working folder.

I add some failsafes, cause with 50 instance there could happen everything. So I check if I really grabbed some text after accessing the file, before that I check if there's really a file (else copy from source).
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)