home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases
- Path: sparky!uunet!uunet.ca!xenitec!tdkcs.waterloo.on.ca!timk
- From: timk@tdkcs.waterloo.on.ca (Tim Kuehn)
- Subject: Re: UDF problem in FoxBase+
- Organization: TDK Consulting Services
- Date: Sat, 9 Jan 1993 18:49:07 GMT
- Message-ID: <1993Jan9.184907.9482@tdkcs.waterloo.on.ca>
- References: <durai.123.726545367@ortta.umn.edu> <1993Jan9.090934.2183@netcom.com> <300@safn8.UUCP>
- Lines: 64
-
- In article <300@safn8.UUCP> rey@safn2 (rey) writes:
- >In article <1993Jan9.090934.2183@netcom.com>, jamesc@netcom.com (James Chuang) writes:
- >>
- >> Since you are using FoxBase+, I don't believe you declare UDF()s with a
- >> FUNCTION keyword. This was introduced in dBase IV ver 1.0, which came
- >> after FoxBase+. In FoxBase+, procedures and functions are declared the
- >> same way:
- >>
- >> PROCEDURE isok
- >> The only difference is that procedures can't accept a return value.
- >> So in your case, just change your declaration to procedure, adn you should
- >> be ok....
- >>
- >> jamesc
- >
- >In SCO foxbase+ I do not recall a FUNCTION keyword, but PRODEDURE gives
- >the same functionality. RETURN is a keyword that returns a value, so
- >the procedure acts like a function. What did you mean "procedures can't accept
- >a return value"?
- >
- >Are SCO foxbase+ procedures recursive? can a UDF call itself?
-
- Easy enough to test. Put the following code segment in a file and
- "set procedure to" it, then "do main"
-
- procedure main
-
- do recurse with 1
- quit
-
- procedure recurse
- parameters num
-
- if (num > 5) then
- return num
- else
- num = num + 1
- do recurse with num
- endif
- return(num)
-
- >Are parameters (arguments) on a stack, so that they can have
- >different values in a UDF from the caller, or are they PUBLIC?
-
- Run the prior program and find out.
-
- >Sorry so much of the thread is missing; but the original problem
- >was that functions (UDF) do not work.
-
- What was the original context you were trying to use the UDF in?
- If you have a file "udfunc.prg" which has "procedure udfunc" at the
- top, the UDF won't work. (Don't know why though, although Fbase/+
- doesn't support multiple procedures in a single file that's not
- "set procedure to"d.) Comment out the "procedure" line and it should
- behave itself.
-
- >Reynolds McClatchey (Southern Aluminum Finishing Co, Atlanta, GA, USA)
- >uunet!safn2!reyi rey@saf.com
-
- +-----------+-----------------------------------+---------------------------+
- | Tim Kuehn | TDK Consulting Services | timk@tdkcs.waterloo.on.ca |
- | <>< | Ask me about news and mail in KW! | (519)-888-0766 |
- +-----------+-----------------------------------+---------------------------+
-
-