Show constant as constant name in Variable Viewer

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Korolev Michael
Enthusiast
Enthusiast
Posts: 200
Joined: Wed Feb 01, 2012 5:30 pm
Location: Russian Federation

Re: Show constant as constant name in Variable Viewer

Post by Korolev Michael »

I mean debug session, not code itself.

During debug session, try to go through loops and watch at VV. Info in VV presented by raw numbers, I can't determine what status of object I have at this moment of time, until rummage in pbi-file with headers.

And If all constants were created with Enumetation function? What will you do?
Former user of pirated PB.
Now registered user :].
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: Show constant as constant name in Variable Viewer

Post by Tenaja »

I think it would be enough (preferred) to have a new tab in the Variable Viewer that (along with variables, arrays, lists, maps) listed all constants.

...and that list could be sorted by order of definition, alphabetically OR by value.
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Show constant as constant name in Variable Viewer

Post by skywalk »

The solution is in your Title: :wink:
Show constant <xx xxxxxxxx xxxx> in Variable Viewer.
Macro created constants are only available with explicit Debug commands or assignments to variable.
It would help to list all constants/enum's in the Variable Viewer.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: Show constant as constant name in Variable Viewer

Post by Danilo »

Korolev Michael wrote:And If all constants were created with Enumetation function? What will you do?

Code: Select all

Enumeration Enum1
    #Failure
    #Success
EndEnumeration

;
; var is of type "Enumeration Enum1"
; and only values of Enum1 can be assigned to it
;
var.Enum1 = #Success

Debug var ; outputs "#Success"
Doesn't work in PureBasic, but it looks like it is what you want (works like this in some other programming languages).
Korolev Michael
Enthusiast
Enthusiast
Posts: 200
Joined: Wed Feb 01, 2012 5:30 pm
Location: Russian Federation

Re: Show constant as constant name in Variable Viewer

Post by Korolev Michael »

@Danilo, almost.
Former user of pirated PB.
Now registered user :].
Post Reply