Scolring - Forum

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.

#1 11-Jan-2024 14:39:01

vinurd
Member
From: irkutsk
Registered: 19-Jul-2014
Posts: 540
Website

Another math question(global var)

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.

https://imgur.com/a/mQ2JXex

Offline

#2 11-Jan-2024 14:49:06

vinurd
Member
From: irkutsk
Registered: 19-Jul-2014
Posts: 540
Website

Re: Another math question(global var)

Please give some example of how to work with mathematics, and to do a few things, add multiply divide

Offline

#3 12-Jan-2024 05:57:50

vinurd
Member
From: irkutsk
Registered: 19-Jul-2014
Posts: 540
Website

Re: Another math question(global var)

I bought a book. But since a virus killed my system. There is no book so there is nowhere to look

Offline

#4 12-Jan-2024 15:03:07

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,091
Website

Re: Another math question(global var)

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

#5 12-Jan-2024 15:04:15

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,091
Website

Re: Another math question(global var)

if you remember the mail you have used to buy the book, I can send you the download link again.

Offline

#6 12-Jan-2024 15:32:19

vinurd
Member
From: irkutsk
Registered: 19-Jul-2014
Posts: 540
Website

Re: Another math question(global var)

arkeon wrote:

if you remember the mail you have used to buy the book, I can send you the download link again.

ilinovik@mail.ru

Offline

#7 12-Jan-2024 15:44:15

vinurd
Member
From: irkutsk
Registered: 19-Jul-2014
Posts: 540
Website

Re: Another math question(global var)

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!

Offline

#8 12-Jan-2024 17:02:09

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,091
Website

Re: Another math question(global var)

mail sent for your ebook smile

Offline

#9 14-Jan-2024 04:58:40

vinurd
Member
From: irkutsk
Registered: 19-Jul-2014
Posts: 540
Website

Re: Another math question(global var)

arkeon wrote:

mail sent for your ebook smile

Yes, thank you very much.

Offline

#10 16-Jan-2024 17:32:44

vinurd
Member
From: irkutsk
Registered: 19-Jul-2014
Posts: 540
Website

Re: Another math question(global var)

vinurd wrote:
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

#11 19-Jan-2024 08:59:09

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,091
Website

Re: Another math question(global var)

what do you mean ? you can write the operation you want in the code, check the log windows for potential code error.

Offline

#12 20-Jan-2024 20:03:18

vinurd
Member
From: irkutsk
Registered: 19-Jul-2014
Posts: 540
Website

Re: Another math question(global var)

arkeon wrote:

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

#13 23-Jan-2024 13:25:40

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,091
Website

Re: Another math question(global var)

ha ok sorry, you can use the pow function in the code : https://www.openspace3d.com/scoldoc/pow.html

Offline

#14 23-Jan-2024 13:33:56

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,091
Website

Re: Another math question(global var)

[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

#15 24-Jan-2024 16:57:38

vinurd
Member
From: irkutsk
Registered: 19-Jul-2014
Posts: 540
Website

Re: Another math question(global var)

arkeon wrote:
[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

#16 26-Jan-2024 16:36:28

vinurd
Member
From: irkutsk
Registered: 19-Jul-2014
Posts: 540
Website

Re: Another math question(global var)

[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

#17 26-Jan-2024 16:48:28

vinurd
Member
From: irkutsk
Registered: 19-Jul-2014
Posts: 540
Website

Re: Another math question(global var)

the only thing is that I calculated the formula manually, for some reason my answer does not match what the program gave

Offline

#18 29-Jan-2024 14:46:55

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,091
Website

Re: Another math question(global var)

in Scol then dot after the math symbol means this operator is for float values.
There is no dot if you use integer only.

Offline

#19 29-Jan-2024 14:48:04

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,091
Website

Offline

Board footer

Powered by FluxBB