Problem with if statement ?.

Moderator: GiD Team

alexsunny123
Posts: 1
Joined: Sat Apr 03, 2021 8:58 am

Problem with if statement ?.

Postby alexsunny123 » Sat Apr 03, 2021 8:59 am

Hello,

I'm trying to use an IF statement in my .bas file as:

*loop intervals
check_mat=*IntvData(1)
*if(IntvData(1)!=0)
*IntvData(1),*IntvData(2),*IntvData(3)
*Set Cond Structure *nodes
*if(CondNumEntities>0)
*loop *nodes *OnlyInCond
*if(strcmp(*cond(1),"Liner")==0)
*cond(2),1,*NodesNum,*cond(4),*cond(3)
*endif
*end nodes
*endif
*endif
*end intervals

with a condition:

NUMBER:30 CONDITION: Structure
CONDTYPE: over lines
CONDMESHTYPE: over nodes
QUESTION: Structural_element#CB#(Liner,Beam,Pile,Rockbolt)
VALUE:Liner
QUESTION: Sequential_ID
VALUE:1
QUESTION: Property_ID
VALUE:1
QUESTION: Segments
VALUE:10
END CONDITION

and:

INTERVAL DATA
QUESTION: Material_ID_to_modify
VALUE:1
QUESTION: Material_ID_to_apply
VALUE:1
QUESTION: Sequential_ID
VALUE:1
END INTERVAL DATA

But it keeps telling me "Error into an *if expression".

Why is it telling me this or what am I doing wrong?

thanks
alexsunny
User avatar
escolano
Posts: 1690
Joined: Thu Sep 18, 2014 3:31 pm

Re: Problem with if statement ?.

Postby escolano » Tue Apr 06, 2021 11:54 am

try specifying that the field value must be considered as an integer with the extra argument ",int"

*if(IntvData(1,int)!=0)

Return to “Customization”

Who is online

Users browsing this forum: No registered users and 1 guest