DO CASE CASE tnMonth = 0 OR tnYear=0 or tnPage = 0 lcUrl="" CASE (tnMonth>=10 AND tnYear=2003) OR tnYear>2003 lcUrl=gcCgiMagazine+'9,7,3,'+gaMonth[tnMonth,1]+ALLTRIM(STR(tnYear))+'/Page'+ALLTRIM(STR(tnPage))+'.asp' OTHERWISE lcUrl=gcClientMagazine+gaMonth[tnMonth,1]+ALLTRIM(STR(tnYear))+'/Page'+ALLTRIM(STR(tnPage))+'.asp' ENDCASE>I have this SQL which contains a UDF function:
>SELECT MagaSche.Numero,Title,Message AS Summary,; > PADR(GetUrlArticleMagazine(MagaSche.Month,MagaSche.Year,MagaSche.Page),250) AS Url,; > MagaSche.Year,MagaSche.Month,MagaSche.Page,MagaSche.Creation FROM MagaSche; > WHERE MagaSche.Month=lnMonth AND MagaSche.Year=lnYear AND MagaSche.Statut=4; > ORDER BY Page INTO CURSOR Temp >>
>* Return the URL for a magazine >* expN1 Month >* expN2 Year >* expN3 Page >FUNCTION GetURLArticleMagazine >PARAMETERS tnMonth,tnYear,tnPage >LOCAL lcUrl >IF (tnMonth>=10 AND tnYear=2003) OR tnYear>2003 > lcUrl=gcCgiMagazine+'9,7,3,'+gaMonth[tnMonth,1]+ALLTRIM(STR(tnYear))+'/Page'+ALLTRIM(STR(tnPage))+'.asp' > ELSE > lcUrl=gcClientMagazine+gaMonth[tnMonth,1]+ALLTRIM(STR(tnYear))+'/Page'+ALLTRIM(STR(tnPage))+'.asp' >ENDIF >RETURN lcUrl >>
>* Return the URL for a magazine >* expN1 Month >* expN2 Year >* expN3 Page >FUNCTION GetURLArticleMagazine >PARAMETERS tnMonth,tnYear,tnPage >LOCAL lcUrl >lcUrl='' >IF (tnMonth>=10 AND tnYear=2003) OR tnYear>2003 > lcUrl=gcCgiMagazine+'9,7,3,'+gaMonth[tnMonth,1]+ALLTRIM(STR(tnYear))+'/Page'+ALLTRIM(STR(tnPage))+'.asp' > ELSE > lcUrl=gcClientMagazine+gaMonth[tnMonth,1]+ALLTRIM(STR(tnYear))+'/Page'+ALLTRIM(STR(tnPage))+'.asp' >ENDIF >RETURN lcUrl >>