Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Is there a way to view/print all existing variables held in memory to console?
Started by AngelaMcCall Dec 03 2019 08:18 AM

3 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

AngelaMcCall

[GLOBAL: userInfoPane.html]
AngelaMcCall
  • Enthusiast

  • 33 posts
  • Corona SDK

Hiya,

I just wondered, is there a way to print out a report of all variables that exist, at any given moment, and what their content is. 

 

Is there a way to do this?

I can print specific variables that I explicitly know of, but I want to see if there are variables existing that shouldn't.

 

Thanks

Angela



[TOPIC: post.html]
#2

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Corona Geek

  • 1,020 posts
  • Corona SDK

These sort of questions would be better asked from Google since the very first link yields an answer from Stack Overflow: https://stackoverflow.com/questions/2834579/print-all-local-variables-accessible-to-the-current-scope-in-lua


  • AngelaMcCall likes this

[TOPIC: post.html]
#3

AngelaMcCall

[GLOBAL: userInfoPane.html]
AngelaMcCall
  • Enthusiast

  • 33 posts
  • Corona SDK

Hi,

Thanks... i didn't know what term to do a search on.
But based on your post I also found this: https://docs.coronalabs.com/tutorial/basics/globals/index.html

It actually lists how to do so. My bad! 

Thanks

Angela



[TOPIC: post.html]
#4

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,393 posts
  • Enterprise

That tutorial shows you how to print the global variables. You however also want all of the local variables. XeduR's Stack Overflow post has that covered.

 

Rob


  • AngelaMcCall likes this


[topic_controls]
[/topic_controls]