Notifications
Clear all

Multiple variables in one textbox/label

5 Posts
3 Users
0 Reactions
3,703 Views
 efs
Posts: 10
Member
Topic starter
 

Is it possible to combine variables in one text frame. E.g. System.Hour + ":" + System.Minutes + ":" + System.Seconds = 10:40:31?  


 
Posted : 15/05/2023 10:39 am CEST
 efs
Posts: 10
Member
Topic starter
 

Is it possibly to read in a variable in the HTMLBox?


 
Posted : 15/05/2023 4:07 pm CEST
Dominik
Posts: 27
Member Admin
 

Yes, it is possible, but you need a little Java script for it.

I attached a test project in which you will find two possibilities of how it could be done.


 
Posted : 17/05/2023 1:06 pm CEST
 efs
Posts: 10
Member
Topic starter
 

Thanks for the help. I think I can get it to work. 

But is it possible, instead of changing a HTML element - the value of the external (E.g. S7) variable is written to a javascript variable inside the HTMLBox?

The reason behind this is that I need to draw something with <canvas> in the HTMLBox and I run some javascript functions inside a script tag in the HTMLBox.


 
Posted : 19/05/2023 9:54 am CEST
Matthias
Posts: 35
Member Admin
 

Hello efs,

you could use the same event that was used in the JavaScript definition page (Events.onVarChanged) in your HTMLBox script to execute some code whenever a variable changes.


 
Posted : 22/05/2023 7:49 am CEST