List All Global Variables

Discussion in 'Questions (Windows Mobile)' started by robinathome, May 4, 2009.

  1. robinathome

    robinathome Member Licensed User

    Hello all,
    I need to debug a programme and I would like to export all Global Variables and their values to a text file. Arrays I will deal with separately. Something like
    fileopen(c1,"Variables.txt",cWrite,cAppend,cASCII)
    For n = 0 to App.GlobalVariables.count-1
    filewrite(c1,App.GlobalVariables(n).name & "," & App.GlobalVariables(n).value)
    next
    fileclose(c1)


    If this can work with all modules then that would be great.
    If this question has already been answered then please can you point me in the right direction.
    Thanks
    Robinathome:sign0085:
     
    Last edited: May 4, 2009
  2. agraham

    agraham Expert Licensed User

    I'm afraid this is not possible as there is no collection of Global variables that can be iterated and you can't get the value of a Global variable as a property.

    If you can't for some reason debug in the IDE and can optimise compile your application you can debug it on either desktop or device with my http://www.basic4ppc.com/forum/additional-libraries/2328-debug-library.html#post12598 which can (amongst other cool things) inspect and change Global variables at runtime. With the next version of Basic4ppc will come an update to this library providing single-step and breakpointing.
     
  3. robinathome

    robinathome Member Licensed User

    agraham

    Thank you for pointing out your Debug Library and I have just tried the Watcher to find the current value(.text) of variables. This will suffice for the moment.:)
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice