Is it feasible to use a ini file to maintain a list of If statements results, like the following
[code]
If>{(%ShpName% = "JONES") AND (%SLCode% = "OOLU")}
SetDialogProperty>BolDialog,SrvContract,Text,AE095045
EndIf
If>{(%ShpName% = "DIVER") AND (%SLCode% = "APLU")}
SetDialogProperty>BolDialog,SrvContract,Text,EXPIRED
EndIf
If>{(%ShpName% = "DIVER") AND (%SLCode% = "HLCU")}
SetDialogProperty>BolDialog,SrvContract,Text,S9NSE129
EndIf
If>{(%ShpName% = "DIVER") AND (%SLCode% = "HJSC")}
SetDialogProperty>BolDialog,SrvContract,Text,EXPIRED
EndIf
If>{(%ShpName% = "DIVER") AND (%SLCode% = "MAEU")}
SetDialogProperty>BolDialog,SrvContract,Text,EXPIRED
[/code]
Or is there a better option, I have about 80 to maintain and it getting a little laborious
Thanks for any and all suggestions
Gil
Using a INI file for If statement results
Moderators: Dorian (MJT support), JRL
-
- Pro Scripter
- Posts: 132
- Joined: Mon Dec 22, 2008 4:56 pm
- Location: St Augustine FL
Gil,
I don't have to many suggestions cause I'm not entirely sure what you are trying to do. Here is an example of logging results to an ini file depending on whether it was a true result or false result to your if statement. Can you expand a bit on what you are trying to do with the inifile?
Not sure if this is what you are looking for but here it is.
I don't have to many suggestions cause I'm not entirely sure what you are trying to do. Here is an example of logging results to an ini file depending on whether it was a true result or false result to your if statement. Can you expand a bit on what you are trying to do with the inifile?
Not sure if this is what you are looking for but here it is.
Code: Select all
//Creating ini named results.ini in my documents folder in case it doesn't exist
IfFileExists>%userdocuments_dir%\results.ini
//do nothing
else
writeln>%userdocuments_dir%\results.ini,success,[results]
endif
//if the query is true it puts AE095045 under the section "results" with an entry named query2result, otherwise it puts the value queryisfalse there.
If>{(%ShpName% = "JONES") AND (%SLCode% = "OOLU")}
SetDialogProperty>BolDialog,SrvContract,Text,AE095045
EditIniFile>%userdocuments_dir%\results.ini,results,query1result,AE095045
else
EditIniFile>%userdocuments_dir%\results.ini,results,query1result,QueryisFalse
EndIf
//if the query is true it puts Expired under the section "results" with an entry named query2result, otherwise it puts the value queryisfalse there.
If>{(%ShpName% = "DIVER") AND (%SLCode% = "APLU")}
SetDialogProperty>BolDialog,SrvContract,Text,EXPIRED
EditIniFile>%userdocuments_dir%\results.iniresults,query2result,EXPIRED
else
EditIniFile>%userdocuments_dir%\results.ini,results,query2result,QueryisFalse
EndIf
I think this is what you are looking for:
Create a text file called Properties.txt
and put the following lines in it:
------------------------------
JONES,OOLU,AE095045
DIVER,APLU,EXPIRED
DIVER,HLCU,S9NSE129
DIVER,HJSC,EXPIRED
DIVER,MAEU,EXPIRED
------------------------------
Code: Select all
//Set Dialog Properties from a comma delimited file
Let>comma=,
Let>k=0
Label>Start
Let>k=k+1
ReadLn>c:\Properties.txt,k,strLine
If>strLine=##EOF##,end
Separate>strLine,comma,Property
If>{(%ShpName% = %Property_1%) AND (%SLCode% = %Property_2%)}
SetDialogProperty>BolDialog,SrvContract,Text,%Property_3%
EndIf
Goto>Start
Label>end
Create a text file called Properties.txt
and put the following lines in it:
------------------------------
JONES,OOLU,AE095045
DIVER,APLU,EXPIRED
DIVER,HLCU,S9NSE129
DIVER,HJSC,EXPIRED
DIVER,MAEU,EXPIRED
------------------------------
-
- Pro Scripter
- Posts: 132
- Joined: Mon Dec 22, 2008 4:56 pm
- Location: St Augustine FL
Using a INI file for If statement results
Yes that's exactly what I was looking for. It will be much easier to maintain.
Thanks Adroege for taking the time to share your knowledge
Gil
Thanks Adroege for taking the time to share your knowledge
Gil