Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
C0000005 with TEXTMERGE()
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00666832
Message ID:
00831668
Vues:
24
Christof,

We just ran into this problem here. Most of the time we do it like this:

TEXT TO lcSQL TEXTMERGE NOSHOW
Select * From Foo
Where fooid = '<>'
ENDTEXT

Instead of:

TEXT TO lcSQL NOSHOW
Select * From Foo
Where fooid = '<>'
ENDTEXT

lcSql = TEXTMERGE(lcSql)

Do you know if doing the textmerge all in one step like my first sample has the same problem?

Thanks,
Lister...

>Hi Agnes,
>
>>Is there a know problem with TEXTMERGE()?
>
>Yes. Under some situations, VFP doesn't add a terminating CHR(0) to the string. If additionally, the string is stored at the end of an allocated memory block, a function in the MSVCRT runtime (strstr) accesses invalid memory. This attempt results in an exception raised by the Windows memory management. To fix this issue, you need to add CHR(0), as Tom mentioned, but also remove it afterwards:
>
>CHRTRAN(TEXTMERGE(lcString+CHR(0)),CHR(0),"")
>
>
>Christof
Lister Potter

Lister Potter & Associates
lister@listerpotter.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform