Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Understanding REPLACE command - why I don't get the erro
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00630443
Message ID:
00630757
Vues:
20
This message has been marked as the solution to the initial question of the thread.
>Hi Mike,
>
>Here is a test program, which completely replicates the problem and our environment: You can notice, what this program didn't produce an error, as it should. I guess, where is nothing I can do except to try to switch to public array idea...
>
>I've tried to add in Y clause, tried to use XX and YY aliases instead of X/Y to no avail...
>
>
< SNIP >

There's how you can get your code to work.
scan
    append blank in Y

	ldDate = GetPrSlInfo(PROPID,SOURCE,DATE,"Date")
    replace Y.TotRooms with 100000, Y.BedRooms with 10000, ;
               Y.PrSlDate with ldDate 

endscan
Looks like the cause of the problem is REPLACE command in the function called from replace. There's the short version of the code that illustrate the problem.
function GetPrSlInfo
lparameter tnPropId, tcSource, tdDate, tcFieldName, tcRetType, tnNumChar, lnRecno, lnReccount
local lnSelect, lVar
lnSelect=select()
lnRecno = recno() && Assuming we're sitting on the correct file
lnReccount = reccount()
if !used('curPrevSlInfo')
	select 0
	create cursor curPrevSlInfo (RecNum I, date D, Price I, Book I, page I)
	append blank	
ENDIF

replace RecNum with m.lnRecno in curPrevSlInfo

Select(lnSelect)

RETURN Date() + lnRecno
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform