Vb Scripting Follow

0
Avatar
Legacy Poster

Wondering if anyone can help, this is basically what I want to do:

When printing a label, I have a prompt dialog box that pops up and on it I have 3 boxes; one to enter a weight variable, eg: 100g, another box to enter a price per kilo variable, eg: $10.00 and another to enter the total price variable, eg: $1.00.

I want to know if you can have the total price box be the product of whatever number I enter in the weight and price per kilo box. Can it be done so it works out the total price automatically?

Help please!

:)

3 comments

0
Avatar
Susan Chen
Moderator

You can use VBScript to calculate the total price for you. To achieve this, you might need to setup sharename which will be used a variable or parameter in VBScript for calculation

1. Prompt box 1: weight -> setup sharename through double click on the datasource-> "Advanced" tab-> On the Share/Name Tab-> give it a sharename for example: weight


2. Prompt box 2: price per kilo, the same procedure for setting sharename for price per kilo for example: priceunit


3. On the label design area
a)you can drag and drop a text object, double click on the object
b)choose VBScript on the data source part and choose Type: Event Control Scripts and click "Edit"
c)On the left side of "OnPostprompt" event, put VBScript program you would like VBScript to perform(For example: value = weight * unitprice....)

Give it a try to see if it fit your need. If you need further assistance, please contact our local office Support contact information: http://www.seagullscientific.com/aspx/technical-support.aspx

Thanks!
0
Avatar
Legacy Poster

It worked brilliantly, thankyou.
0
Avatar
Legacy Poster

I have a field that is using VB Script to calculate Impressions based on other fields. This works well. But I need to have the results truncate to eliminate the decimals of the calculation....not simply displaying zero digits to the right of the decimal, as this causes rounding. Can I use FIX somehow? I can't figure out where and how that fits into the expression.

Please sign in to leave a comment.