Author |
Message |
Jerry Brown (jerrybrown11743)
Member Username: jerrybrown11743
Post Number: 5 Registered: 03-2004
| Posted on Thursday, April 15, 2004 - 10:23 pm: | |
I want to do something like this. But the IF operator doesn't seem to handle arrays. err = IF (stage = 1) THEN array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) ELSE array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) |
Jerry Brown (jerrybrown11743)
Member Username: jerrybrown11743
Post Number: 6 Registered: 03-2004
| Posted on Friday, April 16, 2004 - 01:53 pm: | |
This question is a subset of a larger issue that I should probably explain. I've been searching for a way to make a two-stage calculation in which I feedback some of the results of the first stage to redefine one of the domain boundaries for the second stage. You're suggestion of using ARRAY(#include "yfile" 0) looked promising. However, I can't seem to control the number of data points when I build "yfile" and that makes it impossible to use the REPEAT construct to build the boundary. If ARRAY would accept arguments using the VAL function, I could get the things to work. But, it won't. Also, I can't use variables in the boundary definition even though they are coming from a table in the DEFINITIONS section. |
Robert G. Nelson (rgnelson)
Moderator Username: rgnelson
Post Number: 138 Registered: 06-2003
| Posted on Friday, April 16, 2004 - 03:11 pm: | |
ARRAY is a declaration, like an initialized table in C. IF..THEN wants value arguments. Why not do this: err0 = array(0,0,0...) err1 = array(1,1,1...) thing(index) = if(stage=1) then err0[index] else err1[index] As to the #include file issue, I don't altogether understand what you want to do. Can you send me a file that attempts it? |
Jerry Brown (jerrybrown11743)
Member Username: jerrybrown11743
Post Number: 7 Registered: 03-2004
| Posted on Friday, April 16, 2004 - 07:15 pm: | |
Here is what I wish I could do. The pertinent parts of the program are preceded by comments that start in the first column. |
|