Guest User

wowgarms

a guest
Jan 22nd, 2025
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. class Help {
  2. static var counter = 0;
  3. static function count(message as String) {
  4. System.println("count = " + counter + ": " + message);
  5. var ret = counter;
  6. counter++;
  7. return ret;
  8. }
  9. }
  10.  
  11. // This class is never instantiated
  12. class TestClass {
  13. // This line is only called if TestClass is referenced elsewhere in the app!
  14. // (true whether optimization is enabled or not)
  15. static var staticMember = Help.count("TestClass initialized staticMember");
  16.  
  17. var nonStaticMember = Help.count("TestClass initialized nonStaticMember");
  18. var uninitializedMemberVariable;
  19.  
  20. static var staticMember2 = 5;
  21.  
  22. function initialize() {
  23. uninitializedMemberVariable = Help.count("TestClass uninitializedMemberVariable @ initialize()");
  24. }
  25. }
  26.  
  27. class TestDFView extends WatchUi.DataField {
  28. static var staticMember = Util.Help.count("TestView initialized staticMember");
  29. var nonStaticMember = Util.Help.count("TestView initialized nonStaticMember");
  30. var uninitializedMemberVariable;
  31.  
  32. hidden var mValue as Numeric;
  33.  
  34. function initialize() {
  35. DataField.initialize();
  36. uninitializedMemberVariable = Util.Help.count("TestView uninitializedMemberVariable @ initialize()");
  37. mValue = 0.0f;
  38.  
  39. // System.println("TestClass.staticMember2 = " + TestClass.staticMember2);
  40. System.println(staticMember);
  41. }
  42.  
  43. // Set your layout here. Anytime the size of obscurity of
  44. // the draw context is changed this will be called.
  45. function onLayout(dc as Dc) as Void {
  46. System.println("onLayout");
  47. //...
  48. }
  49. //...
  50. }
Advertisement
Add Comment
Please, Sign In to add comment