Hi. OK I see a few issues here. First off, this line is unnecessary, and seems to be preventing writing to the file. I imagine that this is some kind of permissions issue, but I really have no idea.
Next, your file name is bound to cause problems, because you construct your file name like so
Filename$ = "output" + currentdate$ + currenttime$ + ".txt"
but those strings will contain / and : characters which are invalid for file names.
However the biggest problem seems to be this.
global NumClasses = 14 as integer
global NumLists = 2^NumClasses as integer
global Filename$ = "" as string
global tempst = 0 as byte
global tempin = 0 as byte
global tempwi = 0 as byte
global tempdx = 0 as byte
global tempco = 0 as byte
global tempch = 0 as byte
global currentdate$ = "" as string
global currenttime$ = "" as string
I'm afraid that this is not valid syntax (I'm surprised the compiler doesn't complain) but the result is that NumClasses and NumLists, when are they read later, are assumed to be new variables and so return 0. That is why it is running so quickly. If you replace that with this, then it appears to work (in as much as you get a file full of data anyway, I have no idea if it's the right data!).
global NumClasses as integer : NumClasses = 14
global NumLists as integer : NumLists = 2^NumClasses
global Filename$ as string : Filename$ = ""
global tempst as byte : tempst = 0
global tempin as byte : tempin = 0
global tempwi as byte : tempwi = 0
global tempdx as byte : tempdx = 0
global tempco as byte : tempco = 0
global tempch as byte : tempch = 0
global currentdate$ as string : currentdate$ = ""
global currenttime$ as string : currenttime$ = ""
dim Class(NumClasses) as stats
dim ClassList(NumLists) as stats
I hope that helps! Do let us know if you have any further problems with it