OK My eyes can't find the bug here, but in this function is a GPF waiting to happen, not sure why exactly.
-------------
Scott Turchin
Code:
Type XmitData fName As Asciiz * 60 CardNo As Asciiz * 17 ExpDate As Asciiz * 5 TransAmt As Asciiz * 8 'In Pennies Reference As Asciiz * 255 End Type Global ccData() As XmitData Global Template As String Global OutFile As String ccdata() dimmed in Winmain as XmitData Now, the dialog is read, I've verified there is length to each ccData() string (asciiz) I go to process a credit card, it gets done so I write an output file based on Template (Valid file), The idea is to replace constants in a file with strings, ie %n will be replaced with ccData.fName, then OutFile gets rewritten: Function WriteOutPutFile(ccData() As XmitData) As Long Local F As Long Local G As Long Local x As Long Local y As Long Local a As String Local c As String Local e As String Local n As String Local r As String a = "%a" c = "%c" e = "%e" n = "%n" r = "%r" Dim St(1 To 2000) As String G = FreeFile Open OutFile For Output As #G F = FreeFile Open Template For Input As #F If IsTrue Exist(Template) Then Do Until Eof(F) Incr x 'GPF Occurs on 6th round through loop Line Input #F,St(x) If Len(St(x)) > 1 And Instr(St(x),c ) Then Replace Any c With ccData(x).CardNo In St(x) 'ccData.everything is string If Len(St(x)) > 1 And Instr(St(x),a ) Then Replace Any a With ccData(x).TransAmt In St(x) If Len(St(x)) > 1 And Instr(St(x),e ) Then Replace Any e With ccData(x).ExpDate In St(x) If Len(St(x)) > 1 And Instr(St(x),n ) Then Replace Any n With ccData(x).fName In St(x) If Len(St(x)) > 1 And Instr(St(x),r ) Then Replace Any r With ccData(x).Reference In St(x) Print #G, St(x) Loop Else For x = 1 To wCount Print #G, TimeStamp + ":" Print #G,ccData(x).fName Print #G,ccData(x).CardNo Print #G,ccData(x).ExpDate Print #G,ccData(x).TransAmt Print #G,ccData(x).Reference Print #G, String$(48,"-") Next End If Close F,G Erase St End Function The Html file has the headers below without the brackets for this BBS sake, the 6th position is null, Although I'm checking for it, it's still GPF'ing... html %n %c %e %a %r html
-------------
Scott Turchin
Comment