I lost this little snippet of code and although I could write it again it'd be nice to find. If any of you still have it I'd very much appreciate a copy  
				
			
				This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
				
				

_______________________________________
*** Configuration: OS-X_X86 ***
precompiling:
GPC - GLBasic Precompiler V.10.037 SN:429c3389 - 3D, NET
Wordcount:82 commands
compile+link:
cygwin warning:
  MS-DOS style path detected: C:\Users\tGerk\GLBasic\Samples\_Projects_\Pong\MacIcon.icns
  Preferred POSIX equivalent is: /cygdrive/c/Users/tGerk/GLBasic/Samples/_Projects_/Pong/MacIcon.icns
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Using icns type 'ic09' (ARGB) for 'C:\Users\tGerk\GLBasic\Samples\_Projects_\Pong\tmpMacIcon.png'
Saved icns file to C:\Users\tGerk\GLBasic\Samples\_Projects_\Pong\MacIcon.icns
Creating .app for Pong
run: "Q:\Tools\Icons.exe" "C:\Users\tGerk\GLBasic\Samples\_Projects_\Pong\icon.png" /MACOSX
success
_______________________________________
*** Finished ***
Elapsed: 10.3 sec. Time: 13:55
Build: 1 succeeded.
				
				
				
				
//by default these are 0
global BSDState
global MSState
 
for i = 1 to 10
    print randBSD()
next
 
for i = 1 to 10
    print randMS()
next
 
function randBSD:
    randBSD = (1103515245 * BSDState + 12345) mod (2 ^ 31)
    BSDState = randBSD
endfunction
 
function randMS:
    MSState = (214013 * MSState + 2531011) mod (2 ^ 31)
    randMS = integer(MSState / 2 ^ 16)
endfunction
				
				
CONSTANT FRAMES_PER_SECOND% = 60
CONSTANT SKIP_FRAMES% = 1000 / FRAMES_PER_SECOND
CONSTANT MAX_FRAMESKIP% = 2
FUNCTION GAME_LOOP:
    next_game_tick% = GETTIMERALL()
    LOCAL loops%
	REPEAT
		loops% = 0
		WHILE( GETTIMERALL() > next_game_tick% AND loops% < MAX_FRAMESKIP%)
			GAME_UPDATE()
			next_game_tick = next_game_tick + SKIP_FRAMES
			INC loops%
		WEND
		GAME_RENDER()
	UNTIL (EXIT_LOOP% = TRUE)
ENDFUNCTION
WHILE Quit% = FALSE
	SELECT APPSTATE%
		CASE AS_TITLE_SCREEN% 	; EXIT_LOOP% = FALSE ; TITLE_SCREEN()
		CASE AS_SETTINGS%	 ; EXIT_LOOP% = FALSE ; SETTINGS_SCREEN()
		CASE AS_LEVEL_SELECT%	; EXIT_LOOP% = FALSE ; LEVEL_SELECT_SCREEN()
		CASE AS_GAME_OVER%	; EXIT_LOOP% = FALSE ; GAME_OVER_SCREEN()
		CASE AS_CREDITS%	; EXIT_LOOP% = FALSE ; CREDITS()
		CASE AS_SECRET%		; EXIT_LOOP% = FALSE ; SECRET()
		CASE AS_HIGHSCORES%	; EXIT_LOOP% = FALSE ; HIGH_SCORE_TABLE()
		CASE AS_HIGHENTRY%	; EXIT_LOOP% = FALSE ; HIGH_SCORE_ENTRY()
		CASE AS_HOWTOPLAY	; EXIT_LOOP% = FALSE ; HOW_TO_PLAY()
		CASE AS_GAME_LOOP%	 ; EXIT_LOOP% = FALSE ; GAME_LOOP()
		DEFAULT ; Quit% = TRUE
	ENDSELECT
WEND
				Quote from: TheMapChap on 2015-Feb-08
Error 3 is usually due to keeping a file open when the program ends/crashes.
				Quote from: kanonet on 2015-Feb-02
Thats exactly what I do, thats why I said it would be pointless if the debugger would tell me at what codeline the loading failed - there is only one loading function in whole project. I think the debugger should simply tell the name+path of the file that he failed to load.