Vbscript To Format Weight From Scale Follow

0
Avatar
Legacy Poster

A datatype of number in Bartender 10.1 does not allow VBScripting in the Transforms tab of a data source.   I am trying to make a simple Code 128 barcode with:

  - 5 digit product code

  - 3 or  4 digits for the weight 9.8 -> 0980 or 098  => vb scripting needed

  - 6 digits for a data (yymmdd)

  - 8 digits for a serial number

 

I tried the ConvertToEANUCCSevenDigitMeasurement(Value,2) to convert my weight, but I get a Type Mismatch error.

 

Any help or pointers would be appreciated.

 

Doug

 

 

 

1 comments

0
Avatar
Ian Cummings
Moderator
Comment actions Permalink

It will need to be of a text data type for the particular data source.  I suggest you use the application identifier wizard to create the data sources for your GS1 barcode as it will handle and preconfigure these validation options for you.

 

When you do this the VB script will be as below.  Note however that the value will be expected to be a valid numeric value with a character filter of: 0123456789.,eE-+

 

Value = ConvertToEANUCCSevenDigitMeasurement(Value, 3)

 

If coming from a database field, be sure to set the sample data to be a numeric value in order to avoid a design time error.

Please sign in to leave a comment.