Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology
Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered
You are not logged in.
Pages: 1
how do I access variables through the links between blocks?
I have a big complicated formula. The user enters the data and I need the result to come out when the button is pressed. And the program does not want to see global variables.
Offline
Hello, you will have to use the maths plugIT to do the calculation and set the result in the global Var.
To insert a global var value in a link you can use %MyVar%
You can also do the maths using code in links like
[code]itoa (%MyVar% * 10)[/code]
Offline
Hello, you will have to use the maths plugIT to do the calculation and set the result in the global Var.
To insert a global var value in a link you can use %MyVar%You can also do the maths using code in links like
[code]itoa (%MyVar% * 10)[/code]
thank you very much!
Offline
arkeon wrote:Hello, you will have to use the maths plugIT to do the calculation and set the result in the global Var.
To insert a global var value in a link you can use %MyVar%You can also do the maths using code in links like
[code]itoa (%MyVar% * 10)[/code]
thank you very much!
and how to make exponentiation in this formula??
Offline
what do you mean ? you can write the operation you want in the code, check the log windows for potential code error.
https://imgur.com/a/9mP6cAM
raise the number to a power. How?
Offline
ha ok sorry, you can use the pow function in the code : https://www.openspace3d.com/scoldoc/pow.html
Offline
[code]
let 1.0 -> s in
let 2.0 -> p in
let (pow (1.0 +. p) %MyVarPow%) -. 1.0 -> pp in
ftoa (s *. (p +. (p /. pp)))[/code]
You can replace values by another var
Offline
[code] let 1.0 -> s in let 2.0 -> p in let (pow (1.0 +. p) %MyVarPow%) -. 1.0 -> pp in ftoa (s *. (p +. (p /. pp)))[/code]
You can replace values by another var
thank you very much. Is there a book on this programming somewhere? and I can't understand the syntax of the programming language a bit (let is when we declare a variable and assign it to S and P, then we assign the whole expression to pp and subtract why there is a dot.1.0 and at the end we put everything into a formula and why ftoa ? dot again /.pp)
F# ?
Last edited by vinurd (24-Jan-2024 16:59:21)
Offline
[code]
let (%procent% /. 100.0) ->ps in
let(ps /. 12.0) ->vs in
let (pow (1.0 +. %procent%)%mesyac%) -. 1.0 -> pp in
ftoa (%perSum% *. (vs+. (ps /. pp)))[/code]
everything works.I did not immediately understand the trick with dots after the mathematical actions.
Last edited by vinurd (26-Jan-2024 16:37:09)
Offline
Offline
Pages: 1