Page 1 of 1 1
Topic Options
#126537 - 2004-09-10 10:17 PM Grr I hate this
solostyle Offline
Fresh Scripter

Registered: 2004-07-20
Posts: 15
Loc: maryland, us
I have SetOption ("Explicit"."ON") set and I call a certain .udf file before any functions in that file are used. But I want to get a value back from the udf that I'm calling so that I can use the value. The udf doesn't "return" a value. It just declares a var (DIM $some_var) and sets its value before exiting. How do I get that value? Right now, because it has to be DIM'ed, it gets lots upon Exiting the function.................
_________________________
kickin it solo

Top
#126538 - 2004-09-10 10:25 PM Re: Grr I hate this
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Just "return" the local udf value ($y) as a "return value" of the function, and assign it to another one declared local to you ($x), like this:

Code:

break on

dim $x

$x = myfunc()

?"x=" $x

exit 0

function myfunc()

dim $y

$y = 123

$myfunc = $y

endfunction



-Shawn

Top
#126539 - 2004-09-10 10:26 PM Re: Grr I hate this
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
look in the manual how to set udf to return a value.
clue, it has to do with var and the udf-name.
_________________________
!

download KiXnet

Top
#126540 - 2004-09-10 10:27 PM Re: Grr I hate this
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
insufficient data... does not compute.

If the UDF was not written to support Explicit ON, you will need to rewrite. Maybe if you mentioned what UDF and what value does not get returned with a small snippet of sample code.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#126541 - 2004-09-10 10:31 PM Re: Grr I hate this
solostyle Offline
Fresh Scripter

Registered: 2004-07-20
Posts: 15
Loc: maryland, us
s;lvika;lgiha;li12l;jk;lkrj23t0q

you won't believe.. I think tried every version of what you just described except for the correct version. Thanks again... Mr. Rock!
_________________________
kickin it solo

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 641 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.053 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org