is this code faulty anywhere?

Blitz3D Forums/Blitz3D Beginners Area/is this code faulty anywhere?

Hansie(Posted 2003) [#1]
Const vh_scrwidth = 1024
Const vh_scrheight = 768
Const vh_scrdepth = 0
Const vh_scrmode = 0

If GfxModeExists(vh_scrwidth,vh_scrheight,vh_scrdepth) Then
Goto vh_exit
Else
Graphics vh_scrwidth,vh_scrheight,vh_scrdepth,vh_scrmode
EndIf
.....
.....
....
.vh_exit: end


EOF(Posted 2003) [#2]
Your example program will end/quit if the graphics mode 'exists'.
Try this instead. The program ends only if the graphics mode cannot be set:
Const vh_scrwidth = 1024
Const vh_scrheight = 768
Const vh_scrdepth = 0
Const vh_scrmode = 0

If GfxModeExists(vh_scrwidth,vh_scrheight,vh_scrdepth)
 Graphics vh_scrwidth,vh_scrheight,vh_scrdepth,vh_scrmode
Else
 RunTimeError "Unable to set graphics mode" : End
EndIf



Hansie(Posted 2003) [#3]
Syntax, Error,

The GfxModeExists() is REALLY getting on my nerves! I can't seem to figure out if it affects/relates/checks window'ed programs only, fullscreen only, or a combination ... I seem to get different results depending if I use Windowed mode or not ... #"%¤#&%¤/&%((