Link to home
Start Free TrialLog in
Avatar of cafulford
cafulfordFlag for United States of America

asked on

VFP 6 (Visual Foxpro 6) Error

Hi, I am trying to figure out what the correct syntax is to fix the error in the attached .jpg. I am using VFP6.

Thanks in advance,

Charlie User generated image
Avatar of Olaf Doschke
Olaf Doschke
Flag of Germany image

You give the reason yourself: product.case_qty is a numeric field. You can't use alltrim() - which is a string function - on a numeric value.

While an N(5) field stores it's numeric values in string format in the dbf file, it is converted to numeric (double) in memory, so your if found() else endif is setting HoldThisSAPCaseQty to a numeric value in the if case and the string "FNF" in the else case.

You would need STR(product.case_qty) to make HoldThisSAPCaseQty a string in both cases.

Bye, Olaf.
Avatar of cafulford

ASKER

Hi Olaf,

I was only trying to convert it to a string because I was not sure how to get it embedded in:
strLbl = strLbl + "^FO25,65^BY.33^B3N,N,30,N,N^FD" + AllTrim(HoldThisSAPCaseQty) + AllTrim(label.cust_prod) + "^FS" + CRLF

What is the syntax for adding that field into the statement if I want to keep it numeric?

Thanks,

Charlie
ASKER CERTIFIED SOLUTION
Avatar of Olaf Doschke
Olaf Doschke
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial