Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Interesting result
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Interesting result
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01584697
Message ID:
01584697
Vues:
118
Hi everybody,

I just got unexpected result and thought I'll share.

I've been running a check for duplicate UPC, so I have the following code
select UPC from csrPOLines ;
			with (buffering = .t.) ;
			where UPC = thisform.oPO.UPC  ;
			and not (department = thisform.oPO.department and category = thisform.oPO.category and item = thisform.oPO.item) ;
			into cursor csrUPCCheck NOFILTER
		if _tally > 0

			lnChoice = messagebox('WARNING!' + chr(13)+ "There are multiple rows with UPC = " + alltrim(UPC) +  ;
				". Proceed with save?", 4, "PO Edit Warning")
		endif
And I was getting a warning after I added first item with no UPC and second item with some UPC. I ran that code a few times with the same result and in the debugger and found that row with empty UPC was selected. I somehow didn't realize that it doesn't matter where the column is (in the left or right) but it the length of it matters when the SET ANSI IS OFF.

I'll fix the problem with double == then.
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform