Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding LEFT function to a UDF function within SELECT
Message
From
08/10/2001 19:43:11
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Adding LEFT function to a UDF function within SELECT
Miscellaneous
Thread ID:
00565747
Message ID:
00565747
Views:
39
I have a UDF called SECTIONS.
SELECT SECTIONS(st300.uid,'2000','FALL') FROM st300
gives me blanks, but
SELECT LEFT(SECTIONS(st300.uid,'2000,'FALL'),32) FROM st300
gives me the correct result (string).
Anybody knows why?

Here's the function:
FUNCTION SECTIONS(pUID,pYear,pSem)
LOCAL xRet, xTemp, xSS440
xRet=''
xSS440=zSS+'SS440' &&zSS is a global variable for path to SS files.

DO CASE
CASE UPPER(pSem)="FALL"
xSem='1'
CASE UPPER(pSem)="SPRING"
xSem='2'
CASE UPPER(pSem)="SUMMER"
xSem='0'
ENDCASE

*sts='S' means scheduled.
*List only scheduled sections.
SELECT sts,sec FROM &xSS440 ;
WHERE UID=pUID and sem=xSem and year=pYear and sts='S' ;
ORDER BY UID,per INTO CURSOR xTemp

GO TOP
DO WHILE NOT EOF()
IF EMPTY(xRet) THEN
xRet=str(sec,3)
ELSE
xRet=xret+','+str(sec,3)
ENDIF
SKIP
ENDDO

Return xRet
Next
Reply
Map
View

Click here to load this message in the networking platform