SELECT New.Numero,New.Titre AS Title,New.Message AS Summary,; IIF(New.Type=2,PADR(New.Url,250),; PADR(GetUrlArticleMagazine(New.Month,New.Year,New.Page,New.Type,New.Url),250) AS Url,; New.Creation FROM Temp; INNER JOIN New ON Temp.Numero=New.Numero; ORDER BY 5 DESCENDING INTO CURSOR Tempwhere GetURLArticleMagazine() is:
FUNCTION GetURLArticleMagazine PARAMETERS tnMonth,tnYear,tnPage RETURN 'http://www.something...'In VFP 8, I have found that even if the type is 2, that both conditions will be executed. Thus, it causes a problem as it's not suppose to execute both evaluations but only the one as per the type value.
SELECT New.Numero,New.Titre AS Title,New.Message AS Summary,; GetUrlArticleMagazine2(New.Month,New.Year,New.Page,New.Type,New.Url) AS Url,; New.Creation FROM Temp; INNER JOIN New ON Temp.Numero=New.Numero; ORDER BY 5 DESCENDING INTO CURSOR Tempwhere GetUrlArticleMagazine2() is:
FUNCTION GetURLArticleMagazine2 PARAMETERS tnMonth,tnYear,tnPage,tnType,tcUrl LOCAL lcURL lcURL='' IF tnType=2 lcURL=tcUrl ELSE lcURL='http://www.something...' ENDIF RETURN PADR(lcURL,250)Is this the proper way to do it in VFP 8?