Post Reply 
DIM in a program
04-02-2014, 09:24 AM (This post was last modified: 04-02-2014 09:25 AM by Angus.)
Post: #1
DIM in a program
imagine this piece of code:

Code:

EXPORT foo()
BEGIN
  LOCAL vec=[1,2,3,4,5];
  LOCAL dim1:=DIM(vec);
  dim1:=dim1(1);        //splitting in 2 steps is ok...
  LOCAL dim2:=DIM(vec)(1)   //while this is not
 
  (...)
END;

Is it really not possible to assign something like DIM(vector)(1) to a local in one step?

I tried in cas and that works. I switched home from rpn to textbook and found that calling DIM(vec)(1) is translated to DIM(vec)*(1) there which seems to be a side effect of automatic operator expansion. However in a program such behaviour is painful, you just would not expect your code to be modified by the system.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
DIM in a program - Angus - 04-02-2014 09:24 AM
RE: DIM in a program - eried - 04-02-2014, 09:47 AM
RE: DIM in a program - Angus - 04-02-2014, 10:03 AM
RE: DIM in a program - eried - 04-02-2014, 10:09 AM
RE: DIM in a program - Angus - 04-02-2014, 10:46 AM
RE: DIM in a program - eried - 04-02-2014, 11:48 AM
RE: DIM in a program - Angus - 04-02-2014, 12:12 PM



User(s) browsing this thread: 1 Guest(s)