Page 1 of 1

Can you use variables to perform calculations?

Posted: Tue Mar 10, 2020 9:12 am
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?

Re: Can you use variables to perform calculations?

Posted: Tue Mar 10, 2020 8:26 pm
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.

Re: Can you use variables to perform calculations?

Posted: Wed Mar 11, 2020 1:14 am
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.