Mathematics on variables?

This forum is for all Flare issues not related to any of the other categories.
Post Reply
Atlas
Jr. Propeller Head
Posts: 2
Joined: Tue Aug 11, 2015 6:50 am

Mathematics on variables?

Post by Atlas »

Hi Guys,

I'm messing around with Flare for the first time and trying to do some mathematics (adding, subtracting, etc) on variables.
Google mentioned nothing about this. Is it even possible to do? :)

Cheers,
Alexander
sarrants
Propeller Head
Posts: 86
Joined: Tue Sep 18, 2007 6:04 am
Location: South Burlington, VT

Re: Mathematics on variables?

Post by sarrants »

What are you trying to accomplish?
The things that we plan and measure are the things that get done.
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: Mathematics on variables?

Post by doc_guy »

Variables in Flare may not be exactly the same thing you're thinking of. If you think of it from a programming perspective, all Flare variables are string variables, not number variables, so you can't do any math with them in Flare. I suppose if you wanted to write some javascript to do that on the fly, you could parse out the text of the variable and do something with it, but I'm not sure why you would want to.

So, I'm with sarrants. What are you trying to do? Maybe there is a better way.
Paul Pehrson
My Blog

Image
Atlas
Jr. Propeller Head
Posts: 2
Joined: Tue Aug 11, 2015 6:50 am

Re: Mathematics on variables?

Post by Atlas »

Cheers for the reply guys!

What we want to achieve is a nice way to integrate documentation and customer quotes. So we want to involve some kind of pricing in Flare.
For example: we will have 4 variables for the cost prices of the products and 1 profit margin variable. cost price * profit margin = final customer price which needs to be displayed on the exported PDF.
Is this doable in Flare (withouth too much JS scripting), or do we need to look further?
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Mathematics on variables?

Post by NorthEast »

Atlas wrote:Cheers for the reply guys!

What we want to achieve is a nice way to integrate documentation and customer quotes. So we want to involve some kind of pricing in Flare.
For example: we will have 4 variables for the cost prices of the products and 1 profit margin variable. cost price * profit margin = final customer price which needs to be displayed on the exported PDF.
Is this doable in Flare (withouth too much JS scripting), or do we need to look further?
I'd say it's not doable within Flare itself.

Flare variables don't support calculations.
It also wouldn't be possible with Javascript, since that's for web-based scripting, and you wanted this for a PDF.

However, if you have Adobe Acrobat, I think it's possible to create PDFs that include forms which can handle calculations; e.g. you can fill in boxes and it calculates a result.
Perhaps you could create a PDF in Acrobat, that includes the section requiring the calculation, and then stitch that PDF into your Flare project.
sarrants
Propeller Head
Posts: 86
Joined: Tue Sep 18, 2007 6:04 am
Location: South Burlington, VT

Re: Mathematics on variables?

Post by sarrants »

Atlas wrote:Cheers for the reply guys!

What we want to achieve is a nice way to integrate documentation and customer quotes. So we want to involve some kind of pricing in Flare.
For example: we will have 4 variables for the cost prices of the products and 1 profit margin variable. cost price * profit margin = final customer price which needs to be displayed on the exported PDF.
Is this doable in Flare (withouth too much JS scripting), or do we need to look further?
No, you can't do this with Flare Variables. It is possible with JavaScript, but not for PDF. You can do this in Acrobat. I've seen and used PDFs that ask for information like this in dialogs when opening the document. But unless you're creating this documents more than a few times a week it probably makes more sense to just open the PDF and fill in the calculation areas.
The things that we plan and measure are the things that get done.
Post Reply