[comp.databases] Repost: FOXbase+/mac UDFS ??

cjohnson@acsu.buffalo.edu (charles johnson) (12/20/90)

I am having problems with passing values back from UDFS
the following is an example

***Procedure library
procedure Valid_input
parameters message
**SAY Screen
@ row,col say message get answer
 read
return(ans)

*** calling program
set procedure to library
.
.
.
ans = valid_input(message)
**end of example

I can use it with a "do valid_input with "message" but I am writing an
application that is heavily dependent on UDFs so I don't want to have
to devise a  clumsy work around..the way I use now is global varibles..

any sugestions are greatly appreciated
replies can be sent directly to me and if there is any interest I'
ll post a summary

thanks
Charles Johnson        Database Programmer  cjohnson@acsu.buffalo.edu
School of Dental Medicine    716 834 2057 ext 28
Advanced Educational Technologies Lab  342 Squire Hall



-- 
Charles Johnson        Database Programmer  cjohnson@acsu.buffalo.edu
School of Dental Medicine    716 834 2057 ext 28
Advanced Educational Technologies Lab  342 Squire Hall

a_dent@fennel.cc.uwa.oz.au (01/03/91)

In article <52505@eerie.acsu.Buffalo.EDU>, cjohnson@acsu.buffalo.edu (charles johnson) writes:
> 
> I am having problems with passing values back from UDFS
> the following is an example

You didn't include quite enough information for me to be sure but I would try
the following two changes:
1) include the line "PRIVATE ans"
2) assign some value to ans before the GET

Note, something that may help you understand UDFs is the following note from
some of our research into how FoxBASE+/Mac works...

"
If we pass an expression, the PARAMETER variable is PRIVATE.  However, if we
pass a variable, the value of the PARAMETER variable is copied back to the
caller, even if they are different names!  So, in Pascal terms, passing an
expression gives you Call-by-value and passing a variable gives you
Call-by-reference.
"
> 
> thanks
No problem.  (Sorry I can't mail direct...)

> 
> -- 
> Charles Johnson        Database Programmer  cjohnson@acsu.buffalo.edu
> School of Dental Medicine    716 834 2057 ext 28
> Advanced Educational Technologies Lab  342 Squire Hall
Andy Dent                     A.D. Software phone 09 249 2719
Mac & VAX programmer          94 Bermuda Dve, Ballajura
a_dent@fennel.cc.uwa.oz       Western Australia  6066     
a_dent@fennel.cc.uwa.oz.AU (international)