error in "if" statement

G

Guy Elimelech

Guest
Hi,


the error is:
E- *Error* if: too few arguments (at least 2 expected, 1 given) - (member(via_net net_list))

code:
net_list=list("VDD" "VSS")
sel_via_dbid=axlGetSelSet();listing the selected via's


foreach(via sel_via_dbid
net_dbid=via->net
via_net=net_dbid->name
if(member(via_net net_list)) then
println("net name is VDD or VSS")
else
println("net name is:%s" via_net)
)

what am i missing here?

Thanks,
Guy
 
On 03/04/14 20:25, Guy Elimelech wrote:
Hi,


the error is:
E- *Error* if: too few arguments (at least 2 expected, 1 given) - (member(via_net net_list))

code:
net_list=list("VDD" "VSS")
sel_via_dbid=axlGetSelSet();listing the selected via's


foreach(via sel_via_dbid
net_dbid=via->net
via_net=net_dbid->name
if(member(via_net net_list)) then
println("net name is VDD or VSS")
else
println("net name is:%s" via_net)
)

what am i missing here?

Thanks,
Guy

Guy,

Your parentheses are in the wrong place. if() is a function, and so the
parentheses need to be around the entire arguments, not just the
condition (it's not C, although it looks a bit like C). So it should be:

foreach(via sel_via_dbid
net_dbid=via->net
via_net=net_dbid->name
if(member(via_net net_list) then ; removed a paren
println("net name is VDD or VSS")
else
println("net name is:%s" via_net)
) ; added a paren
)

Regards,

Andrew.
 
On Sunday, March 9, 2014 11:01:11 PM UTC+2, Andrew Beckett wrote:
On 03/04/14 20:25, Guy Elimelech wrote:

Hi,





the error is:

E- *Error* if: too few arguments (at least 2 expected, 1 given) - (member(via_net net_list))



code:

net_list=list("VDD" "VSS")

sel_via_dbid=axlGetSelSet();listing the selected via's





foreach(via sel_via_dbid

net_dbid=via->net

via_net=net_dbid->name

if(member(via_net net_list)) then

println("net name is VDD or VSS")

else

println("net name is:%s" via_net)

)



what am i missing here?



Thanks,

Guy





Guy,



Your parentheses are in the wrong place. if() is a function, and so the

parentheses need to be around the entire arguments, not just the

condition (it's not C, although it looks a bit like C). So it should be:



foreach(via sel_via_dbid

net_dbid=via->net

via_net=net_dbid->name

if(member(via_net net_list) then ; removed a paren

println("net name is VDD or VSS")

else

println("net name is:%s" via_net)

) ; added a paren

)



Regards,



Andrew.

Thank you very much!
 

Welcome to EDABoard.com

Sponsor

Back
Top