Let>g=0
Label>FindFirstGroupThatHasUsers
Let>g=g+1
ReadIniFile>iniFile,Group%g%,UserCount,usercount
let>count=%usercount%
If>count>0
Let>RadioGroupString=%g%
Goto>TheOtherGroups
Endif
Goto>FindFirstGroupThatHasUsers
In this segment of code I beginning a string for a radio button group.
There seem to be some sortof problem with Let> g=g+1
When i watch the debug g counts up as expected but for g=1 I return
the usercount for group0 once g=2 the usercount=
nothing returned and i get an error reading the ini file
If i type the group number ex: Let>g=0
Label>FindFirstGroupThatHasUsers
Let>g=g+1
ReadIniFile>iniFile,Group%g%,UserCount,usercount
let>count=%usercount%
If>count>0
Let>RadioGroupString=%g%
Goto>TheOtherGroups
Endif
Goto>FindFirstGroupThatHasUsers
In this segment of code I beginning a string for a radio button group.
There seem to be some sortof problem with Let> g=g+1
In the debug watch list g counts up as expected but for g=1 I return
the usercount for group0. With g=2 the usercount=
nothing returned and I get an error reading the ini file
If I type the group# into the code ex: ReadIniFile>iniFile,Group3,UserCount,usercount
I get a return for usercount that is correct
I tested this for all 8 Groups
Why do I seem to have a problem with Let>g=g+1 when g shows the
number expected in the debug watch list?
I have used this same type of code elsewhere in the macro
the only difference is that in the other cases I used Repeat>
Is there some sort of problem with going back to Label> ?
trouble with code
Moderators: Dorian (MJT support), JRL
No it really doesnt make sense because I replaced the variable %g%
with a constant for each group and read back properly from the ini file.
Also I had already tried the same code using ucount instead of usercount,
and the code still failed.
So the code works if I manually type a number in place of %g% but for
some reason will not work with g as a variable.
with a constant for each group and read back properly from the ini file.
Also I had already tried the same code using ucount instead of usercount,
and the code still failed.
So the code works if I manually type a number in place of %g% but for
some reason will not work with g as a variable.
I see you reposted while I was typing. Glad its working.
This works for me.
Let>g=-1
// If you have a group 0 you need to start at g=-1
Label>FindFirstGroupThatHasUsers
Let>g=g+1
ReadIniFile>c:\testiniFile.txt,Group%g%,UserCount,usrcount
//renamed usercount variable to usrcount otherwise the second time
//through the loop the variable usercount=
//because the variable is named the same as the INI file entry.
let>count=%usrrcount%
If>count>0
Let>RadioGroupString=%g%
Goto>TheOtherGroups
Endif
Goto>FindFirstGroupThatHasUsers
This works for me.
Let>g=-1
// If you have a group 0 you need to start at g=-1
Label>FindFirstGroupThatHasUsers
Let>g=g+1
ReadIniFile>c:\testiniFile.txt,Group%g%,UserCount,usrcount
//renamed usercount variable to usrcount otherwise the second time
//through the loop the variable usercount=
//because the variable is named the same as the INI file entry.
let>count=%usrrcount%
If>count>0
Let>RadioGroupString=%g%
Goto>TheOtherGroups
Endif
Goto>FindFirstGroupThatHasUsers