Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Works in Command Window but not when running form
Message
De
02/12/2014 18:31:37
Al Doman (En ligne)
M3 Enterprises Inc.
North Vancouver, Colombie Britannique, Canada
 
 
À
02/12/2014 18:21:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01611698
Message ID:
01611712
Vues:
44
>>>I have the following query
>>>Select csrBOM_1.*, pUniq_Key As Assy_uniq, pAssyNo As assy_no, pAssyRev As Assy_Rev, pAssyDesc As Assy_Desc, ;
>>>				pCustAssy As Cust_Assy, lnLevel As nLevel, pUniq_Key As Bom_Parent ;
>>>				FROM csrBOM_1 Where (PART_SOURC IN('PHANTOM', 'MAKE')) Or ;
>>>				(PART_SOURC = 'MAKE' And PHANT_MAKE) Into Cursor csrBOM_Two Readwrite
>>>
>>>When it runs in a compiled app it gives an error "Function Arguement value, type, or count is invalid"
>>>
>>>If I run the application in VFP and put it in Debug mode it will error when that line is encountered
>>>
>>>If I cut and paste the line into the command window it executes properly.
>>>
>>>I changed the query to
>>>Select csrBOM_1.*, pUniq_Key As Assy_uniq, pAssyNo As assy_no, pAssyRev As Assy_Rev, pAssyDesc As Assy_Desc, ;
>>>				pCustAssy As Cust_Assy, lnLevel As nLevel, pUniq_Key As Bom_Parent ;
>>>				FROM csrBOM_1 Where PART_SOURC IN ('PHANTOM', 'MAKE') Or ;
>>>				(PART_SOURC = 'MAKE' And PHANT_MAKE) Into Cursor csrBOM_Two Readwrite
>>>
>>>( Removed a set of parens and added a space after the IN parameter)
>>>
>>>and now the query runs in the app and command window.
>>>
>>>Is there something about the extra parens and/or the missing space that could cause this?????
>>>
>>>Thanks........Rich
>>
>>My guess it's related to the lack of a space after IN. Not having a space makes VFP think it's a function. Since IN is a reserved word that gives weird effects. For example, when I type HELP IN() in the Command window, I get a "Missing operand" error, rather than going into Help at some point close to the missing IN() function.
>>
>>So, inadvertently or purposefully trying to use an IN() function is probably a bad idea.
>
>Thanks for the response...
>
>That was my feeling also, but I was hoping for insight on why the space matters when running a form, but not when running in the command window
>
>Probably just "one of those things" for which there is no explanation. @#$% happens!

When you ran the command in the Command window, were you in Suspend mode in the debugger? If so maybe the parser handles the statement differently in Suspend mode. I'm surprised it would have run at all in the Command window, I would have expected it to fail always.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform