Announcement

Collapse
No announcement yet.

TYPE Arrays (again)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Lance Edmonds
    replied
    or...

    DIM CCDATA(1:10000) AS GLOBAL XMITDATA



    -------------
    Lance
    PowerBASIC Support
    ( mailto:[email protected][email protected]</A> )

    Leave a comment:


  • Scott Turchin
    replied
    Weird, thot I tried that, but it did it! Thank ya much!

    Scott

    -------------
    Scott Turchin


    Leave a comment:


  • jcfuller
    replied
    Scott,

    Global ccData() As XmitData

    In WinMain
    REDIM ccData(1:1000)


    James

    Leave a comment:


  • Scott Turchin
    started a topic TYPE Arrays (again)

    TYPE Arrays (again)

    It's been a year or more since I probed using an array with a TYPE.
    Now I would like to do it, and while I can work around NOT doing it, it's a good time to do it:
    I don't thin kI'm doing this correct however. I'm getting a "Missing Declaration CCData in the ReadCCFile function.

    The program will use a freeware DLL to dial up and process credit card information, their freeware app dials per user, I want to send 106 users at one time in one dialed connection so it can be done without monitoring:

    Code:
    Type XmitData
         Fname      As Asciiz * 21
         MI         As Asciiz * 2
         LName      As Asciiz * 31
         CardNo     As Asciiz * 17
         ExpDate    As Asciiz * 5
         TransAmt   As Asciiz * 6
    End Type
    Global ccData As XmitData
    global wCount as Long
    In Winmain I declare:
    Dim ccData(1 To 1000) As XmitData
    
    
    And when the Process button is pressed I read the file, and this is where it gets tricky:
    
    '------------------------------------------------------------------------------
    
    Function ReadCCFile() As Long
    Local F As Long
    Local St As String
    
    
    'Sample of the file:
    'John D. Doe, 0000000000000000,0800,10000
    'Mary M. Doe, 0000000000000000,0102,20000
    'Fname MI LName, CC #, Exp Date, Value\100 (No decimal)
    If IsTrue Exist(SourceFile) Then
       F = FreeFile
       Open SourceFile For Input As #F
       Do Until Eof(F)
          Line Input #F, St  '
          Incr wCount
          ccData(wCount).Fname = Parse$(St,Any ",;",1)
          ccData(wCount).MI    = Parse$(St,Any ",;",2)
          ccData(wCount).LName = Parse$(St,Any ",;",3)
          ccData(wCount).CardNo = Parse$(St,Any ",;",4)
          ccData(wCount).ExpDate = Parse$(St,Any ",;",5)
          ccData(wCount).TransAmt = Parse$(St,Any ",;",6)
       Loop
       Close F
       Function = %TRUE
    Else
       MsgBox SourceFile + " does not exist!",%MB_ICONSTOP,CCS
       Exit Function
    End If
    End Function
    -------------
    Scott Turchin


Working...
X