Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
APPEND FROM inconsistencies
Message
From
10/01/2006 10:00:36
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
APPEND FROM inconsistencies
Miscellaneous
Thread ID:
01085187
Message ID:
01085187
Views:
94
This routine creates a Tab Delimited textfile tabdeli.txt:
#define ccTAB	chr(9)
#define ccCRLF	chr(13)+chr(10)

local lcT

lcT = ;
	'a'   + ccTAB + 'b'   + ccTAB + 'c'   + ccTAB + 'd'   + ccCRLF + ;
	        ccTAB +         ccTAB +         ccTAB +       + ccCRLF + ;
	'"e"' + ccTAB + '"f"' + ccTAB + '"g"' + ccTAB + '"h"' + ccCRLF + ;
	        ccTAB +         ccTAB +         ccTAB +       + ccCRLF + ;
	        ccTAB +         ccTAB +         ccTAB +       + ccCRLF + ;
	"'i'" + ccTAB + "'j'" + ccTAB + "'k'" + ccTAB + "'l'" + ccCRLF + ;
	        ccTAB +         ccTAB +         ccTAB +       + ccCRLF + ;
	'm'   + ccTAB + 'n'   + ccTAB + 'o'   + ccTAB + 'p'   + ccCRLF

strtofile( m.lcT, 'tabdeli.txt' )
Now create a cursor tabdeli:
create cursor tabdeli (f1 c(5),f2 c(5),f3 c(5),f4 c(5))
Now do the next variations of APPEND FROM from the command window and browse the results:
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
append from tabdeli.txt type delimited with '  with character TAB
Notice that line 1 gives weird results. Line 2 gives the expected result. Line 3 gives the expected result. Line 4 gives an error.
This is, at the least, inconsistent behavior. It is also an indication that the much adviced use of TWO double-quotes is 'wrong'.

These findings have been reproduced in vfp7 and vfp9.
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.
Next
Reply
Map
View

Click here to load this message in the networking platform