Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why GETWORDNUM and GetWordCount not support CHR(0)? BUG?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00824750
Message ID:
00824854
Vues:
22
>Hi Fabio,
>
>I think it's a bug.
>
>>HI,
>>
>>On VFP, any string function support CHR(0).
>>
>>But GETWORDNUM and GetWordCount no.
>>
>>
>>x='a'+CHR(0)+'b'
>>? GetWordCount(m.x,CHR(0)),GETWORDNUM(m.x,1,CHR(0))
>>? ALINES(ax,x,CHR(0)),ax[1],ax[2]
>>
>>
>>Ill-fatedly, GETWORDNUM(m.dllcPrm, 1, CHR(0)) would be the best VFP function in order to extract one VFP string from one "zero string" of one DLL in C.
>>
>>
>>? SUBSTR(m.dllcPrm,1,AT(CHR(0),m.dllcPrm)-1)
>>
>>
>>Another question:
>>because execution time for ( and m.dllcPrm long )
>> SUBSTR(m.dllcPrm,1,AT(CHR(1),m.dllcPrm)-1)
>>respect to
>> GETWORDNUM(m.dllcPrm, 1, CHR(1))
>>is faster,
>>
>>GETWORDNUM() it can be improved.
>>
>>Fabio

Sergey,

This is a problem because of the fact that in C strings are terminated by CHR(0)and was a problem in the same function in Foxtools. The workaround is to simply use STRTRAN() to convert the CHR(0) to another character (i.e. CHR(13)).
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform