Can you use variables to perform calculations?

This forum is for all Flare issues not related to any of the other categories.
Post Reply
crownjulesb
Propeller Head
Posts: 14
Joined: Tue Aug 07, 2018 1:31 am
Location: Watford, UK

Can you use variables to perform calculations?

Post by crownjulesb »

Variables seem to be quite simplistic in Flare, either being text or date content, which is just displayed by choosing the correct value in the target.
Can variables contain numerical content, which then can be used e.g. in a sum further down the document? Or at least within the same topic?
I.e. points available in a method, which may change over time, with the total displayed in a summary table that updates itself?
Or would I have to investigate coding that myself?
doloremipsum
Sr. Propeller Head
Posts: 290
Joined: Mon Aug 26, 2019 2:11 pm

Re: Can you use variables to perform calculations?

Post by doloremipsum »

That's... not really the intent of variables in Flare. I don't think it has any capacity to do calculations at all. So you could absolutely create variables for numbers and update them manually over time, but if you wanted to calculate anything with them you would have do it yourself.
in hoc foro dolorem ipsum amamus, consectimur, adipisci volumus.
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Can you use variables to perform calculations?

Post by NorthEast »

You can't directly reference a Flare variable in a bit of javascript.

But you can insert a variable into the HTML of your topic page - e.g. as regular text inside a tag, or maybe as the content of a data attribute on a tag.

Then you can use javascript to read that content from the HTML and do something with it.
Post Reply