Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Previous section Next section Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Topic:
Are Variables declared in Global Libraries visible in a Page Script?
This thread has 3 replies. Displaying all posts.
Post 1 made on Saturday August 22, 2020 at 17:06
mpg7321
Regular Member
Joined:
Posts:
June 2020
55
If you set a variable in a library script and you make that library available to an activity. Is there any thing special needed to be done to use that variable in a page script of that activity?

So in the library script, lets say

Var Feedback = feedback;
feedback being the returned data.

Can I simple us that variable in an "IF Statement" in a script on a page in that activity?

Last edited by Lyndel McGee (moderator) on August 25, 2020 15:04.
Post 2 made on Saturday August 22, 2020 at 20:12
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,609
Var Feedback = feedback;

First off. 'var' is lowercase. Might this be your problem?

If the variable is in the library, that is at Global Scope which is the parent of Activity Scope which is the parent of Page scope which is the parent of Button/Local Scope. The Dev Guide does not explicitly mention JavaScript 'Global Scope' but that is where libraries are loaded.

So, yes, the variable should be visible if you don't have syntax errors.

Note that in the Activity in question, you must also check the box to 'include' your library under the ProntoScript Libraries tab of the Activity Properties.

Note that if you added your library to the System Activity, you must check the box to include it there or within your Activity, you must call System.include(nameofyourjsfile).

Please have a look at Chapter 6 of the Dev Guide and Section 4.3 Variable Scope of the Flanagan 5th Edition book (You can likely find the PDF online via a google search).

Last edited by Lyndel McGee on August 22, 2020 22:50.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 3 made on Sunday August 23, 2020 at 12:28
mpg7321
Regular Member
Joined:
Posts:
June 2020
55
The capital V in var was just a typo in this post. So far I am not getting it to work. So got some playing around to do. LOL
Post 4 made on Sunday August 23, 2020 at 13:21
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,609
If the variable was declared outside of a function it should be visible.
Lyndel McGee
Philips Pronto Addict/Beta Tester


Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.

Hosting Services by ipHouse