11/21/2024 7:21 PM | |
Joined: 10/10/2019 Last visit: 2/6/2025 Posts: 2 Rating:
|
I can not get a Global Script to execute. I have a Global Definition as: const globalDebugWindowPath = '/DebugWindowMain/txtDebug'; and a Function as: export function write(source, msg) { let dbgWindow = Screen.FindItem(globalDebugWindowPath); dbgWindow.Text = dbgWindow.Text + '\r\n [' + source + '] ' + msg; } I have a Global Definition on a button on a Main Screen: import * as deBug from 'DeBug'; And a Script on the Button as: let V = Tags('ScreenX').Read(); //Global debug.write('Read Tag', 'The Value of the ScreenX Tag is = ' + V + '.'); It should Work!? Can anyone help? ------------------------------------------------------------------------------------------ |
Last edited by: Moderator_Lan at: 11/21/2024 22:48:40New subject after splitting GR |
|
11/22/2024 5:35 AM | |
Joined: 1/21/2013 Last visit: 2/12/2025 Posts: 3537 Rating:
|
Hi, It may just be a typo in your post, but since JavaScript is case-sensitive, you would need to call your write function with deBug.write(). Or change your import statement to import * as debug from 'DeBug'. And of course, your script module must be named 'DeBug'. However, by using the debugger, you can easily find the reason why your script is not working. Kind regards |
This contribution was helpful to
1 thankful Users |
11/22/2024 1:01 PM | |
Joined: 10/10/2019 Last visit: 2/6/2025 Posts: 2 Rating:
|
Stefan, Thank you! |
GR |
|
Follow us on