Property value settings...
-
- User
- Posts: 20
- Joined: Sun Apr 05, 2015 9:13 pm
Property value settings...
All properties in the PB library need some way to test or determine their current value.
For instance, EnableGraphicalConsole(State) turns the graphical mode on, but there is currently no means to test which setting it currently posseses.
Is my console in graphical mode or text mode?
When I get to a certain point in my code, I need to know what the value of this and others properties are in order to determine on which route to proceed with my subsequent procedures or methods. I can't depand on remembering whether or not I turned it (them) on.
For instance, EnableGraphicalConsole(State) turns the graphical mode on, but there is currently no means to test which setting it currently posseses.
Is my console in graphical mode or text mode?
When I get to a certain point in my code, I need to know what the value of this and others properties are in order to determine on which route to proceed with my subsequent procedures or methods. I can't depand on remembering whether or not I turned it (them) on.
Re: Property value settings...
Since you're the only one who can set it, you already know what it is. Why can't you depend on that?GypsyPrince wrote:there is currently no means to test which setting it currently posseses.
-
- User
- Posts: 20
- Joined: Sun Apr 05, 2015 9:13 pm
Re: Property value settings...
I'm the only one who can eat my own food. Why would I settle for eating bread or crackers every day when there is the possibility to splurge and have a delicious steak?
Oh, I know... because realistically I have no actual need for such a property and just thought I would toss a random question into the air - just because.
Don't you think if that I didn't have a need for it, whether or not you understand that need, I wouldn't have asked for it? Again, can someone in these forums just answer questions directly and politely without the need for questioning the intentions of the asker, and without snide commentary?
Oh, I know... because realistically I have no actual need for such a property and just thought I would toss a random question into the air - just because.
Don't you think if that I didn't have a need for it, whether or not you understand that need, I wouldn't have asked for it? Again, can someone in these forums just answer questions directly and politely without the need for questioning the intentions of the asker, and without snide commentary?
Re: Property value settings...
You mean like yours?GypsyPrince wrote:without snide commentary?

Re: Property value settings...
I agree, more functions could get a pair of Set/Get functions.
-
- User
- Posts: 20
- Joined: Sun Apr 05, 2015 9:13 pm
Re: Property value settings...
Thanks, Danilo.
The gentleman (or gentlemen - I don't know any names) who created and maintain PureBasic obviously have a great deal of talent and expertise, far more than myself. So, I'm quite certain he/they have a valid reason for not creating the Set/Get compliments for each property, even if it is just that they haven't gotten around to doing it, or maybe even they don't want to. All I can do is politely make a suggestion, and they politely reply either yay or nay... LOL
PureBasic is a kick-ass program!!!
The gentleman (or gentlemen - I don't know any names) who created and maintain PureBasic obviously have a great deal of talent and expertise, far more than myself. So, I'm quite certain he/they have a valid reason for not creating the Set/Get compliments for each property, even if it is just that they haven't gotten around to doing it, or maybe even they don't want to. All I can do is politely make a suggestion, and they politely reply either yay or nay... LOL
PureBasic is a kick-ass program!!!

Re: Property value settings...
Uh oh. It is never good news to get the attention of a juror...juror wrote:You mean like yours?GypsyPrince wrote:without snide commentary?
Anyway, GP, please do not be quick to discard comments like what Dude has said. We here do not know all of your capabilities, and forum text "tone" is easily misunderstood. Also, "we" often offer suggestions to workaround things posted on the wishlist that have not yet been implemented.
Re: Property value settings...
My comment was not snide at all. It was a legitimate question as to why you can't depend on a setting that you personally set. Please educate me because I'm obviously missing some point.GypsyPrince wrote:Again, can someone in these forums just answer questions directly and politely without the need for questioning the intentions of the asker, and without snide commentary?
Re: Property value settings...
When writing add-on commands and libraries, you don't know the current state of a 'property'
that was set by the programmer.
For example current drawing mode, and current drawing colors, etc.
Even when used directly, it frees you from maintaining many state variables.
Some possibly eligible candidates:
In general: If you are able to set a state/mode/value, you should be able to get the current state/mode/value. 
that was set by the programmer.
For example current drawing mode, and current drawing colors, etc.
Even when used directly, it frees you from maintaining many state variables.
Some possibly eligible candidates:
Code: Select all
Setter Getter
-------------------------------------------------------------------------
BackColor() ? GetBackColor
ClipOutput() ? GetClipRect
DrawingFont() ? GetDrawingFont / GetDrawingFontID
DrawingMode() ? GetDrawingMode
FrontColor() ? GetFrontColor
ConsoleLocate() ? GetConsoleCursorLocation (GetConsoleMouseLocation?)
ConsoleTitle() ? GetConsoleTitle
EnableGraphicalConsole() ? GetConsoleMode
? GetConsoleWidth (in characters)
? GetConsoleHeight (in characters)
LoadFont() ? GetFontName/GetFontSize/GetFontFlags
GadgetToolTip() ? GetGadgetTooltip
HideGadget() ? IsGadgetHidden
DisableGadget() ? IsGadgetDisabled
HideWindow() ? IsWindowHidden
DisableWindow() ? IsWindowDisabled
StickyWindow() ? IsWindowSticky
RotateSprite() ? GetSpriteRotation
ZoomSprite() ? GetSpriteZoomX/Y
SpriteBlendingMode() ? GetSpriteBlendingMode
SpriteQuality() ? GetSpriteQuality
TransparentSpriteColor() ? GetSpriteTransparentColor
DisableToolBarButton() ? IsToolBarButtonDisabled
PauseThread() ? IsThreadPaused
ThreadPriority() ? GetThreadPriority
Reversing Object Number and Object ID (handle)
-------------------------------------------------------------------------
FontID ? FontFromID
GadgetID ? GadgetFromID
WindowID ? WindowFromID
...

Re: Property value settings...
Adding one to Danillos list: IsMenuEnabled()
-
- Addict
- Posts: 4779
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: Property value settings...
+1 from me.
That would be pretty useful, especially when creating libraries, as Danilo wrote.
A separate "Get" function is not always needed, the "Set" function often can return the current state, e.g.
That would be pretty useful, especially when creating libraries, as Danilo wrote.
A separate "Get" function is not always needed, the "Set" function often can return the current state, e.g.
Code: Select all
*previousErrorHandler = OnErrorCall(@currentErrorHandler())
[...]
If *previousErrorHandler <> #Null
OnErrorCall(*previousErrorHandler)
EndIf