Search found 2 matches

by shinn
Tue Aug 05, 2014 12:00 pm
Forum: Other questions
Topic: Variable assignment in if statements
Replies: 4
Views: 2427

Re: Variable assignment in if statements

I used the typical "nrniv mwe.hoc". Running "nrniv -c "myparam=10" mwe.hoc" gives the expected result of

Code: Select all

5 
Case 2
by shinn
Tue Aug 05, 2014 9:23 am
Forum: Other questions
Topic: Variable assignment in if statements
Replies: 4
Views: 2427

Variable assignment in if statements

Hello, I have encountered some unexpected behavior when assigning a variable in an if statement. Consider the following minimal working example, which checks to see if a variable was passed via a -c command line argument: print name_declared("myparam") if (name_declared("myparam"...