do while

Discussion of Inner Space

Moderators: Lavish Software Team, Moderators

Post Reply
bountycode
Non-Subscriber
Posts: 22
Joined: Mon Jul 12, 2004 8:27 am

do while

Post by bountycode » Tue Mar 01, 2005 6:49 am

this code runs and gives me no errors but the while part does not seem to work

function main()
{
declare t int local 1
do
{
echo ${t}
varcalc t ${t}+1
}
while ${t}<=10
}

it displays the value being increase but it get to 10 and past 10 never stoping the do while loop

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Tue Mar 01, 2005 12:44 pm

< has special meaning unless it is used within quotes

Code: Select all

function main&#40;&#41;
&#123;
  declare t int local 1
  do
  &#123;
    echo $&#123;t&#125;
    varcalc t $&#123;t&#125;+1
  &#125;
while "$&#123;t&#125;<=10"
&#125; 

bountycode
Non-Subscriber
Posts: 22
Joined: Mon Jul 12, 2004 8:27 am

Post by bountycode » Tue Mar 01, 2005 6:39 pm

that did it thanks :)

Post Reply