RATS unresponsive

Use this forum to post questions about syntax problems or general programming issues. Questions on implementing a particular aspect of econometrics should go in "Econometrics Issues" below.
cap
Posts: 11
Joined: Thu Aug 14, 2008 2:32 pm

RATS unresponsive

Unread post by cap »

I am having a problem where RATS becomes completely unresponsive and will not evaluate even the simplest code submitted, and shows no errors in the output window.

I began with the following code, which works fine:


--------------------------

compute counter = 0


do i=1,10



if condition
{

compute counter = counter + 1

}




end do i



more code

-------------------------



But if I add one more little part, so that it becomes the following,
then RATS becomes completely unresponsive, and no code submitted will be run.



--------------------------

compute counter = 0


do i=1,10



if condition
{

compute counter = counter + 1

}




end do i


if counter.eq.0
{
some code
}



more code

-------------------------

It would be nice if RATS could display any sort of error message for this, but none come up.

Any ideas?


-CP
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: RATS unresponsive

Unread post by TomDoan »

cap wrote:I am having a problem where RATS becomes completely unresponsive and will not evaluate even the simplest code submitted, and shows no errors in the output window.

I began with the following code, which works fine:

Code: Select all

compute counter = 0
do i=1,10
if condition
   {
   compute counter = counter + 1
   }
end do i
more code

-------------------------

But if I add one more little part, so that it becomes the following,
then RATS becomes completely unresponsive, and no code submitted will be run.

--------------------------

Code: Select all

compute counter = 0
do i=1,10
   if condition
      {
      compute counter = counter + 1
      }
end do i
if counter.eq.0
   {
   some code
   }
more code
-------------------------

It would be nice if RATS could display any sort of error message for this, but none come up.

Any ideas?


-CP
In the second case, the "IF" puts RATS into compile mode. It's looking for the signal to take it out of that. An END will do that. If that looks weird, rewrite as

Code: Select all

{
if counter.eq.0
   {
   some code
   }
}
The { here is implied when RATS sees an "IF" outside of another compiled section, and it needs an explicit } or END to terminate the section.
Post Reply