Const AmountX=8
Const AmountY=12
Global TotalInfo=(AmountX*AmountY)
Dim Info( TotalInfo )
For a=0 To TotalInfo-1
Info(a)=Rand(0,12288)
Next
SaveInfo( "BuddiesGirl", ".bas" )
Function SaveInfo( SaveFile$, Extension$=".txt" )
Local tmpText$ = ""
FileOut=WriteFile( SaveFile$+Extension$ )
;
; sort out file values
;
For Index = 0 To TotalInfo-1
;
; Have we reached the very Last entry?
;
If Index = TotalInfo-1 Then
WriteLine Fileout, Str( Info(Index))+" }"
Else
If LineCount < AmountX-1 Then
;
; Carry on as usual with adding a comma between data.
;
tmpText = tmpText + Str(Info( Index )) + ","
Else
;
; Cool, I see we have reached the end of the current line, signified by adding ,_
;
tmpText = tmpText + Str(Info( Index ))+",_"
WriteLine fileout, tmpText
tmpText = ""
LineCount = 0
End If
End If
LineCount = LineCount + 1
Next
CloseFile FileOut
End Function