Discussion of Inner Space
Moderators: Lavish Software Team, Moderators
-
Placemate
- GamingTools Subscriber
- Posts: 16
- Joined: Wed Oct 13, 2004 12:54 pm
Post
by Placemate » Thu Jun 30, 2005 3:36 am
Code: Select all
function main()
{
declare i int local 1
do
{
echo ${i}
if "1"
continue
}
while "${i:inc}<10"
}
This loop will never exit, i isn't being incremented for some reason.
-
Darkgecko
- Non-Subscriber
- Posts: 23
- Joined: Sun Sep 26, 2004 5:04 am
Post
by Darkgecko » Thu Jun 30, 2005 4:36 am
Code: Select all
function main()
{
declare i int local 1
do
{
echo ${i}
}
while "${i:Inc}<10"
}
Is going to count to 10 and then stop.
Code: Select all
function main()
{
declare i int local 1
do
{
echo ${i}
if "1"
continue
}
while "${i:Inc}<10"
}
Is going to count to "1" and then because you said if "1" continue, it's going to leave the "do" command and ignore the while, and start all over, hence echoing 1 forever. Which is what you are telling it to do there.
If I am wrong someone correct me please

-
Darkgecko
- Non-Subscriber
- Posts: 23
- Joined: Sun Sep 26, 2004 5:04 am
Post
by Darkgecko » Thu Jun 30, 2005 5:08 am
Well after reading the wiki again, I guess it should do the :Inc afer all
Ignore previous post which I cant edit!
-
Lax
- Owner
- Posts: 6634
- Joined: Fri Jun 18, 2004 6:08 pm
Post
by Lax » Thu Jun 30, 2005 7:52 am
indeed, it should do the :Inc. However, it's not capitalized and it wouldn't work like that even if there wasnt the continue bug

Which is now fixed in LavishScript 1.30 and will be included in the next IS build. Thanks for the report