Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Barcode from Codeplex
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01499507
Message ID:
01499568
Views:
75
Hi,

My partner in this project (Guillermo Carrero) could reproduce the error "OPERATOR TYPE MISMATCH" if there is an open table with a non-numeric field called "Num"

Is that your case?

We will correct that in the next release of FoxBarcode.

As a workarround for your case search into Int2Float() and Float2Int() functions (in gpImage2.prg) containing the variable "Num" and rename it "lnNum" or "m.num"

Thanks for your feedback



>Hi
>
>I did several tests and concluded:
>
>The example on the bottom of page does not work with "set path" or locfile()
>
>Mismach error in function.
>
>It works if I do "set default to directory"
>
>But with set default I can not automate.
>
>I need some help
>
>Moises
>
>
>
>
>>>I executed the class as you said, but mismach error at gpimage2.prg
>>>
>>>CASE num < 0
>>>
>>>
>>>
>>>
>>>FUNCTION Int2Float(num) && By Anatoly Mogylevets - found in www.fox.wikis.com
>>>  * converts FoxPro numeric to 32-bit float form
>>>  #DEFINE REAL_BIAS 127
>>>  #DEFINE REAL_MANTISSA_SIZE 23
>>>  #DEFINE REAL_NEGATIVE 0x80000000
>>>  #DEFINE EXPONENT_MASK 0x7F800000
>>>  #DEFINE MANTISSA_MASK 0x7FFFFF
>>>  LOCAL sgn, exponent, mantissa
>>>  DO CASE
>>>    CASE num < 0   ****************************************************  OPERATOR TYPE MISMATCH
>>>      sgn = REAL_NEGATIVE
>>>      num = -num
>>>    CASE num > 0
>>>      sgn = 0
>>>    OTHERWISE
>>>      RETURN 0
>>>  ENDCASE
>>>
>>>
>>
>>Run this example:
>>
>>
SET PROCEDURE TO LOCFILE("Source\FoxBarcode.prg"), LOCFILE("Source\gpImage2.prg") ADDITIVE
>>
>>*--- Create FoxBarcode Object
>>LOCAL loFbc
>>loFbc = CREATEOBJECT("FoxBarcode")
>>
>>*-- Set the properties
>>WITH loFbc
>>  .cImageType = "BMP"
>>  .nBarcodeType = 110 && Code 128
>>  .cSet128 = "C" && Set 128 C
>>  .nImageHeight = 100
>>  .nFactor = 2
>>ENDWITH
>>
>>*-- Generate image
>>lcImage = loFbc.BarcodeImage("123456789012")
>>
>>*-- Create form
>>LOCAL loForm AS FORM
>>loForm = CREATEOBJECT("Form")
>>loForm.CAPTION = "FoxBarcode example"
>>loForm.WIDTH = 800
>>loForm.HEIGHT = 400
>>loForm.AUTOCENTER = .T.
>>loForm.ADDOBJECT("Image1", "Image")
>>loForm.Image1.PICTURE = lcImage
>>loForm.Image1.VISIBLE = .T.
>>loForm.SHOW(1)
>>loForm = NULL
>>loFbc = NULL
>>
>>RETURN
>>
>>Or better, run Main.prg to show you the form FoxBarcode Demo.
>>
>>
DO Main.prg
Luis María Guayán
Tucumán, Argentina
________________________________
SysOp de www.PortalFox.com
Nada corre como un zorro
________________________________
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform