Hi David,

(We can use '=' as the comparison operator, but I prefer the '==' C/C++/Java syntax).

Well, here is the script I tested on latest Windows Snapshot.

text:
scalar state = 13
scalar delta = 0.001

if state==13
    delta=.38
elif state==16
    delta=.35
elif state==31
    delta=.30
elif state==84
    delta=.26
  else delta=0
endif

printf "%d => %f", state, delta
---

We may have found a bug here:
The statement  "else delta=0" is not being evaluated! Please test this.

Hélio


On Mon, Aug 16, 2010 at 5:12 PM, david santini <divadsantini@yahoo.com> wrote:
hey, thanks for responding, but I'm still getting the 'error evaluating if', even when I replace all '=' with '=='.   Any chance you could type the basic code exactly how it should look?  -david

--- On Mon, 8/16/10, gretl-users-request@lists.wfu.edu <gretl-users-request@lists.wfu.edu> wrote:

From: gretl-users-request@lists.wfu.edu <gretl-users-request@lists.wfu.edu>
Subject: Gretl-users Digest, Vol 43, Issue 17
To: gretl-users@lists.wfu.edu
Date: Monday, August 16, 2010, 12:00 PM

Send Gretl-users mailing list submissions to
    gretl-users@lists.wfu.edu

To subscribe or unsubscribe via the World Wide Web, visit
    http://lists.wfu.edu/mailman/listinfo/gretl-users
or, via email, send a message with subject or body 'help' to
    gretl-users-request@lists.wfu.edu

You can reach the person managing the list at
    gretl-users-owner@lists.wfu.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Gretl-users digest..."


Today's Topics:

   1. if statement (david santini)
   2. if statement error (david santini)
   3. Re: if statement error (H?lio Guilherme)


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

Message: 1
Date: Sun, 15 Aug 2010 21:20:20 -0700 (PDT)
From: david santini <divadsantini@yahoo.com>
Subject: [Gretl-users] if statement
To: gretl-users@lists.wfu.edu
Message-ID: <886407.82767.qm@web53207.mail.re2.yahoo.com>
Content-Type: text/plain; charset="iso-8859-1"

Dear Gretl community,

I keep getting errors on my if statements.? The program responds "error evaluating if", as if it doesn't recognize the command, yet turns red when i type it.?

Here's the code I am using:

if state=13
??? delta=.38
elif state=16
??? delta=.35
elif state=31
??? delta=.30
elif state=84
??? delta=.26
else delta=0
endif

I've been over the syntax in the user manuals and cannot understand what I am doing wrong.? Any insights on this issue are greatly appreciated.? Thanks.?



     
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wfu.edu/pipermail/gretl-users/attachments/20100815/a7201c59/attachment-0001.html

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

Message: 2
Date: Sun, 15 Aug 2010 21:43:10 -0700 (PDT)
From: david santini <divadsantini@yahoo.com>
Subject: [Gretl-users] if statement error
To: gretl-users@lists.wfu.edu
Message-ID: <666713.29338.qm@web53202.mail.re2.yahoo.com>
Content-Type: text/plain; charset="iso-8859-1"

Dear Gretl community,

I
keep getting errors on my if statements.? The program responds "error
evaluating if", as if it doesn't recognize the command, yet turns red
when i type it.?

Here's the code I am using:

if state=13
??? delta=.38
elif state=16
??? delta=.35
elif state=31
??? delta=.30
elif state=84
??? delta=.26
else delta=0
endif

I've been over the syntax in the user manuals and cannot understand what I am doing wrong.? Any insights on this issue are greatly appreciated.? Thanks.?



     
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wfu.edu/pipermail/gretl-users/attachments/20100815/bf0aee57/attachment-0001.html

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

Message: 3
Date: Mon, 16 Aug 2010 15:44:44 +0100
From: H?lio Guilherme <helioxentric@gmail.com>
Subject: Re: [Gretl-users] if statement error
To: Gretl list <gretl-users@lists.wfu.edu>
Message-ID:
    <AANLkTim7HYiZUbMX1QqAG91CMJL4BiwqMtR+qjp6+HBv@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Use comparison '==' and not the assignment symbol '=' in the if clause.

On Mon, Aug 16, 2010 at 5:43 AM, david santini <divadsantini@yahoo.com>wrote:

> Dear Gretl community,
>
> I keep getting errors on my if statements.  The program responds "error
> evaluating if", as if it doesn't recognize the command, yet turns red when i
> type it.
>
> Here's the code I am using:
>
> if state=13
>     delta=.38
> elif state=16
>     delta=.35
> elif state=31
>     delta=.30
> elif state=84
>     delta=.26
> else delta=0
> endif
>
> I've been over the syntax in the user manuals and cannot understand what I
> am doing wrong.  Any insights on this issue are greatly appreciated.
> Thanks.
>
>
> _______________________________________________
> Gretl-users mailing list
> Gretl-users@lists.wfu.edu
> http://lists.wfu.edu/mailman/listinfo/gretl-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wfu.edu/pipermail/gretl-users/attachments/20100816/9b820477/attachment-0001.html

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

_______________________________________________
Gretl-users mailing list
Gretl-users@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users

End of Gretl-users Digest, Vol 43, Issue 17
*******************************************