TGC Codebase Backup



Window Config File by DarkSin

8th Oct 2004 20:59
Summary

Easy to use and implament skeleton of a config file. Requires Enhancement Pack installed. This will show you how to read from a file and setup the starting window to be on or off,



Description

This is ready to be implamented quick without problem. Just be sure to have a file in the main directory with the exe that is named as what you have loading with something similare to:
1,800,600,32
1 = Window on, anything makes window off
The next 2 sections define first the width and then the height
The last one (in the example #32) will tell it the depth



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    open data file "config.csv",",",1
windowmode$ = get data file cell(1,1,1)
windowwidth$ = get data file cell(1,2,1)
windowheight$ = get data file cell(1,3,1)
windowdepth$ = get data file cell(1,4,1)
close file 1

if val(windowmode$) = 1
   set window on
else
   set window off
endif

set display mode val(windowwidth$),val(windowheight$),val(windowdepth$)

wait key