Forum Discussion
5 Replies
Sort By
Hi
I suggest that you see the "Declaring JScript Variables and Constants" and "User Defined Data Types" MSDN articles.- pvidalContributorHello Alex,
Yes, I found those links before. The only form that does not gives a syntax error in TestComplete is "var <name> = <value>;". All the rest gives you a syntaxt error while processing "const":
const daysInWeek = 7;
const favoriteDay = "Friday";
const daysInWeek : int = 7;
Regards,
Patricio.
Hi Patricio,
Sorry for the confusion. The articles I gave you are regarding JScript .NET. The scripting language used in TestComplete is not a .NET version. In regular JScript, constants are not supported, so the "const" statement is not available.
I suggest that you use variables instead. Please see the "About Variables" and the "Code Metrics" articles for the information.- asdfasdfasdfasdContributorTo minimize your global namespace, I suggest you create constants under an object literal:
var Constants = {
A : 1,
B : 2,
C : 3
}; - pvidalContributorGood idea. Thanks!
Patricio.
Related Content
- 12 years ago
- 5 years ago
Recent Discussions
- 2 days ago