PDA

View Full Version : arrays



fortress
01-11-2004, 11:49 PM
is it possable to pass an array and return an array from a udf

not just one element but the entire array

fortress
01-12-2004, 12:20 AM
nm i dont even know why i asked that because i was already doing it in another function hehe

ok it is getting late :)

fortress
01-12-2004, 12:49 AM
ok the better question is how to return multi data types from a UDF

i have tried this

x,y,z = myfunction(a,b,c)

myfunction: a, b, c
{
do work
return(x,y,v);
}

or vary similar and that doesnt work

so any ideas

faulknermano
01-12-2004, 03:41 AM
Originally posted by fortress
nm i dont even know why i asked that because i was already doing it in another function hehe

ok it is getting late :)

you know what? i recall having little success with that. cant recall any specific situation but i know i've been frustrated before with not being able to return arrays.. or at least having some problems doing so. usually, i just resorted to have the arrays as globals.

faulknermano
01-12-2004, 03:42 AM
Originally posted by fortress
ok the better question is how to return multi data types from a UDF

i have tried this

x,y,z = myfunction(a,b,c)

myfunction: a, b, c
{
do work
return(x,y,v);
}

or vary similar and that doesnt work

so any ideas

to properly use associative assignments you have to enclose them in parentheses:



(x,y,z) = myFunc(a,b,c);

fortress
01-12-2004, 04:20 AM
ahh cool thanks
yea so far getting arrays to return is weird if i just have one return ok np but more then one and it desnt work correctly or at least the way i would think it would

well for now i only need one return i found a faster work aorund to some other code i was wrighting