Problem with ini file

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Ghost24de
Newbie
Posts: 13
Joined: Thu Aug 15, 2013 11:24 am

Problem with ini file

Post by Ghost24de » Wed Nov 27, 2013 10:19 pm

Hello,
i have a ini file and in this file i have some declarations and the compl. number of the different tasks!
Here in this file i have 4

the prog... read the ini file and the compl. nr of declarations. then it begin at the last... her nr 4 and there it read the
bregnextrundate and bregnextruntime
after the nr 4 it read the nr 3 then 2 and so on

I have the Problem, it read the nr 4 (first one) then it read
bregnextrundate and bregnextruntime thats ok, but at the next stepp (read nr 3) it doesent read bregnextrundate and bregnextruntime and so on ... the same on nr 2 and nr 1 and if it beginns from the start again (count down to 0 it begin again on 4) it is the same on the task 4 task 3 and so on....
so... it read only one time at the start from the prog the value and not again.
But why? what have i do wrong?
Sry about my bad english!
;-)

here the ini file:
*********************************
//*** Variablen declaration ***
//Dynamicvariable

[task_all]
breganzahl=4


[1]
bregnextrundate=27.11.2013
bregnextruntime=22:43:00
breguser=1
bregpass=2
bregmail=3
bregbirth=
bregprovider=
bregstate=
[2]
bregnextrundate=27.11.2013
bregnextruntime=22:45:00
breguser=4
bregpass=5
bregmail=6
bregbirth=
bregprovider=
bregstate=
[3]
bregnextrundate=27.11.2013
bregnextruntime=21:11:00
breguser=7
bregpass=8
bregmail=9
bregbirth=
bregprovider=
bregstate=
[4]
bregnextrundate=28.11.2013
bregnextruntime=22:46:00
breguser=a
bregpass=b
bregmail=c
bregbirth=
bregprovider=
bregstate=
************************

here is the prog:
************************

//***Umgebung Festlegen***
Let>RP_WINDOWMODE=1
Let>RP_DISPLAYERROR=0
Let>IGNOREERRORS=1
Let>RP_ADMIN=1


//***Install Ordner ermitteln***
//****************************************************************************
//Folgende Zeilen sind nur bei Entwicklung ausgeschaltet, müssen für inst. wieder eingeschaltet werden
//RegistryReadKey>HKEY_CURRENT_USER,Software\PSNET,Installation,strFolderName

//****************************************************************************
//Nächste Zeile legt den install ordner für die Entwicklungsphase fest
Let>strFolderName=D:\Temp
//****************************************************************************
Label>Start


//***Aktive Anzahl der Tasks aus File laden***
ReadIniFile>%strFolderName%\PSNET\Sheet\bregruntime.ini,task_all,breganzahl,bregtaskall
Let>a=%bregtaskall%

Label>bregTaskcheck
IF>a>0
//***Werte aus ini File lesen für entsprechende Task Nr***
ReadIniFile>%strFolderName%\PSNET\Sheet\bregruntime.ini,%a%,bregnextrundate,bregnextrundate
ReadIniFile>%strFolderName%\PSNET\Sheet\bregruntime.ini,%a%,bregnextruntime,bregnextruntime

//***Aktuelles Datum ermitteln***
GetDate>current_date

//***Aktuelle Uhrzeit ermitteln***
Gettime>current_time

If>%current_date%=%bregnextrundate%

If>%current_time%=%bregnextruntime%

Message>Date and time arrived from Task %a%

Endif

Endif

Let>a=a-1

//CPU entlasten im nächsten Schritt
wait>0.0005
ELSE
Goto>Start
ENDIF
Goto>bregTaskcheck

Exit
************************

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Nov 28, 2013 9:16 am

This is a duplicate of http://www.mjtnet.com/forum/readinifile ... t8073.html

There is precisely nothing to be gained by posting duplicates in the forum unless you WANT to make MORE work for us and you WANT to annoy us.

It will NOT wake us up in the middle of the night so that we can answer you more quickly. It will NOT miraculously cause more people to log in and see your posts, so does NOT make you more likely to get an answer or get you an answer more quickly.

But it WILL make more work for us which means it will SLOW us down and DELAY our ability to help people.

Thank you.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Ghost24de
Newbie
Posts: 13
Joined: Thu Aug 15, 2013 11:24 am

Post by Ghost24de » Thu Nov 28, 2013 10:34 pm

Hi,
mhh ok, you are right, but i am not confident...is it a post for the technical or for the beginners area.. and so i have post it double.


Sorry about this one!

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Nov 29, 2013 10:06 am

Doesn't really matter we'll see it anyway. Would rather something was in the "wrong" forum than duplicated! :-)
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts