HzanRsxa2959

Local Variable Scope Test

Jun 6th, 2021 (edited)
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. {$CLEO .cs}
  2. {$USE CLEO+}
  3.  
  4. int testvariable0 = 0 // assigned to variable 0@
  5. int testvariable1 = 0 // assigned to variable 1@
  6. int testvariable2 = 0 // assigned to variable 2@
  7. int testvariable3 = 0 // and so on
  8. int testvariable4 = 0
  9. int testvariable5 = 0
  10. int testvariable6 = 0
  11. int testvariable7 = 0
  12. int testvariable8 = 0
  13. int testvariable9 = 0
  14. int testvariable10 = 0
  15. int testvariable11 = 0
  16. int testvariable12 = 0
  17. int testvariable13 = 0
  18. int testvariable14 = 0
  19. int testvariable15 = 0
  20. int testvariable16 = 0
  21. int testvariable17 = 0
  22. int testvariable18 = 0
  23. int testvariable19 = 0
  24. int testvariable20 = 0
  25. int testvariable21 = 0
  26. int testvariable22 = 0
  27. int testvariable23 = 0
  28. int testvariable24 = 0
  29. int testvariable25 = 0
  30. int testvariable26 = 0
  31. int testvariable27 = 0
  32. int testvariable28 = 0
  33. int testvariable29 = 0
  34. int testvariable30 = 0
  35. int testvariable31 = 0
  36. int testvariable32 = 0
  37. int testvariable33 = 0
  38.  
  39. 0E6F: stream_custom_script_from_label @testlabel testvariable3 // the same goes for 0AB1 (CLEO_CALL)
  40.  
  41. while true
  42. wait 0
  43. end
  44.  
  45. //begin scope
  46. int testvariable2 = 0 // should be assigned to variable 0@, but gets assigned to variable 2@, also the one at line 6 loses its highlighting
  47. int testvariable34 = 0
  48.  
  49. // also, suppose that the limit of local variables has been reached (all 32 have been declared/used in a single scope), the compiler throws an error when declaring a new local variable because although the local variables are scoped in 0AB1 and 0E6F, they are not in the compiler
  50.  
  51. :testlabel
  52. while true
  53. wait 0
  54. end
  55. //end scope
Add Comment
Please, Sign In to add comment