Is there something like RuntimeError or Abort?

Started by thaaks, August 23, 2005, 03:46:56 PM

Previous topic - Next topic

thaaks

Hi,
while porting my Blitz game to PlayBasic I looked for something like RunTimeError(msg$).
In Blitz this function just terminates the program with a message box showing msg$.

Is there some PlayBasic equivalent?

Tommy

empty

#1
Nope.
A function to simulate that behaviour would look like this:

Psub RunTimeError(Message$)
  Local Title$ = GetScreenTitle$()
  Local handle = GetScreenHandle()
  Local user32 = GetFreeDll()
  LoadDll "user32.dll", user32
  CallDll user32, "MessageBoxA", Handle, Message$, "Runtime Error", $10
  DeleteDll user32
  End
EndPsub

thaaks