Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
APPEND FROM inconsistencies
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
01085187
Message ID:
01085591
Vues:
22
>>>>>Peter,
>>>>>
>>>>>I doubt that you may get consistent result with inconsistent information here. The delimited format has limitations, and you ran in one of it when using delimiters that were already used as information piece.
>>>>
>>>>How do you mean, inconsistent information?
>>>
>>>I mean, there are Special/Reserved characters that are used for special purposes, and here they are (quotation marks, ", ') used in particular for delimiting.
>>>If the record contains those characters, then it is no common way to recognize some of them as information, others as delimiters.
>>
>>This is odd reasoning. Of all characters that are used to delimit character values, the double quotation mark is the most common! DELIMITED WITH is especially used to specify the character value delimiter. So, specifying " is a very logical action.
>
>Cannot see any logic to use quotes HERE as delimiters, because they already used as a valid information in the record. There us no way to distinquish between those quotes belong to record, and used as delimiters.

Indeed, if the double quotation mark is the delimiter for character strings AND if it must be removed, then the next commands have a similar effect:
append from tabdeli.txt delimited with TAB
append from tabdeli.txt type delimited with " with character TAB
Apparently specifying TWO double quotation marks does not generate an error BECAUSE vfp expects the delimiter WITHIN these marks. E.g. the next commands have a similar effect. (First add a line to tabdeli.prg that uses the / as delimiter.)
append from tabdeli.txt type delimited with "/" with character TAB
append from tabdeli.txt type delimited with / with character TAB
It appears that if there is NOTHING within, that vfp gets confused and messes things up. To me this clearly is a BUG.

And what do you think of the next examples?
append from tabdeli.txt type delimited with '/' with character TAB
append from tabdeli.txt type delimited with '' with character TAB
append from tabdeli.txt type delimited with ''' with character TAB
Surely interesting results and also indicative that there is a bug involved.


>>>>
>>>>>You need to use the delimiter other than double or singles quotes here.
>>>>
>>>>Most notably the 1st statement is often advised here.
>>>>
>>>>>By the way, I did not have any problem with your fourth statement; and it was the only one that gave the consistent result.
>>>>
>>>>What a coincidence! For the sake of clear code I added a space behind the quote. Please redo the statement, but now without the additional space:
>>>>
append from tabdeli.txt type delimited with '  with character TAB
>>>>append from tabdeli.txt type delimited with ' with character TAB
>>>
>>>Anyway it would be better to avoid using reserved characters/words for not their direct purposes. Otherwise you may get unexpected results.
>>
>>Did or did you not get the error?
>
>Error on the second line.

Glad you found it too.
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform