Yes/No Box?

BlitzMax Forums/BlitzMax Programming/Yes/No Box?

Chroma(Posted 2007) [#1]
I can't remember if there was a built in Yes/No box command for BMax (not MaxGUI). Anyone know or remember?

Bah...just typed in Confirm and it highlighted. I don't have access to the docs atm btw...


Chroma(Posted 2007) [#2]
Yep it's:

a = Confirm("Yes or No?")

But let me ask this instead, how do you strip a path from a filename?

ie. C:/projects/tony/Orbicus/savedata/save1.dat

I can do it with my own function....but is there a native command to strip the path away similar to the StripExt command?

EDIT:
StripDir....omg....just......nm.....


Brucey(Posted 2007) [#3]
And for your next rhetorical question? ;-)


Chroma(Posted 2007) [#4]
Ok you asked for it! =p

How do you save a pixmap as a .jpg?!


GfK(Posted 2007) [#5]
Just a sec... I'll call Captain Obvious....

Captain Obvious says: SavePixmapJpeg()

:D


BlitzSupport(Posted 2007) [#6]

But let me ask this instead, how do you strip a path from a filename?

ie. C:/projects/tony/Orbicus/savedata/save1.dat


Not sure whether you want to retain the filename or the path...

f$ = "C:/projects/tony/Orbicus/savedata/save1.dat"
dir$ = ExtractDir (f$)
file$ = StripDir (f$)



GfK(Posted 2007) [#7]
A small note of caution - be careful if you use ExtractDir.

If you're going to tack a filename on to the end of it later, make note that it does not retain the trailing slash - need to put it back yourself.

^^voice of experience :/


Grey Alien(Posted 2007) [#8]
' -----------------------------------------------------------------------------
' ccAddSlash: Adds a forward slash onto a path if it needs it
' -----------------------------------------------------------------------------
Function ccAddSlash$(path$)
If Right(path$, 1) <> "/" And Right(path$, 1) <> "\" Then
Return path$ + "/"
Else
Return path$
End If
End Function


plash(Posted 2007) [#9]
weird thread.


Chroma(Posted 2007) [#10]
SavePixmapJpeg()



I guess SavePixmapJPG() would have been TOO obvious. Hrmm...that command doesn't highlight...

BUT!!! How do you clear the screen?!! Figure that one out Einstein!


TeaVirus(Posted 2007) [#11]
Function ClearScreenEventually()
	Local r:Int, g:Int, b:Int
	GetClsColor(r, g, b)
	SetColor(r, g, b)
	For Local y:Int = 0 Until GraphicsHeight()
		For Local x:Int = 0 Until GraphicsHeight()
			Plot x, y
		Next
	Next
End Function



JazzieB(Posted 2007) [#12]
Ha-ha, except you have GraphicsHeight() instead of GraphicsWidth() for the x axis :-p


Czar Flavius(Posted 2007) [#13]
Cls



I thought I'd say just in case ;)


FlameDuck(Posted 2007) [#14]
weird thread.
And yet comparatively sane.


GfK(Posted 2007) [#15]
And yet comparatively sane.
Yeah, just wait til Nebula finds it..... :s