Optional parameter requests - any more?

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
TI-994A
Addict
Addict
Posts: 2701
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: Optional parameter requests - any more?

Post by TI-994A »

sancho2 wrote:I use a blank msgbox often during debugging...
Hi sancho. For the time being, you could simply use a macro:

Code: Select all

Macro Yo
  MessageRequester("", "")
EndMacro

Yo
:lol:
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: Optional parameter requests - any more?

Post by Danilo »

WinAPI MessageBox_() caption defaults to "Error" (in User's system language).

Code: Select all

Procedure MsgBox(Title.s="",Text.s="", Flags=0, WindowID=0)
    Protected lpText, lpCaption
    If Text <> ""  : lpText    = @Text  : EndIf
    If Title <> "" : lpCaption = @Title : EndIf
    ProcedureReturn MessageBox_(WindowID,lpText,lpCaption,Flags)
EndProcedure

MsgBox()
MsgBox("","My Text")
MsgBox("","My Text",#MB_ICONERROR)
MsgBox("","",#MB_ICONERROR)
MsgBox("","",#MB_ICONEXCLAMATION|#MB_ABORTRETRYIGNORE)
MsgBox("","",#MB_ICONINFORMATION|#MB_YESNOCANCEL)
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: Optional parameter requests - any more?

Post by Thunder93 »

Just add the following line into the procedure..

Code: Select all

If Title = "" : Title = " " : EndIf
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
User avatar
kenmo
Addict
Addict
Posts: 2033
Joined: Tue Dec 23, 2003 3:54 am

Re: Optional parameter requests - any more?

Post by kenmo »

kenmo wrote:

Code: Select all

OpenFileRequester
SaveFileRequester
PatternPosition could default to 0
Just re-discovered that PatternPosition does nothing on Mac OS X (and SelectedFilePattern() always returns 0?).

That's more reason that PatternPosition shouldn't be required 8)
Post Reply