Post Reply 
Size of a list passed to a function?
04-14-2017, 02:17 PM (This post was last modified: 04-14-2017 02:29 PM by toml_12953.)
Post: #3
RE: Size of a list passed to a function?
(04-14-2017 12:43 PM)Tyann Wrote:  
PHP Code:
EXPORT dimension(mylist)
BEGIN
  
PRINT(SIZE(mylist));
END
fonctionne pour moi sur la machine physique.

Works for me on the physical machine.

I over simplified my program. I'm shooting for a program to automatically create a multi-dimensional list and am hoping to use a variable number of dimensions. Right now, I have to create a loop for each dimension. Here's a better sample.
It works for a fixed number of dimensions if I take out the PRINT.

PHP Code:
EXPORT dimension(varname,mylist)
BEGIN
    local v
,a;
    
v:=HVars(varname);
    print(
SIZE(mylist));
    for 
R:=1 to mylist(1) do
        for 
C:=1 to mylist(2) do
            for 
a:=1 to mylist(3) do    
                
v(R,C,a):=0;
            
end;
        
end;
    
end;
    return 
v;
END

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Size of a list passed to a function? - toml_12953 - 04-14-2017 02:17 PM



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