Solved

Reading from a sequential file!!!

Posted on 1998-11-12
8
216 Views
Last Modified: 2010-04-30
I have to read from a sequential file to diffrent fields and calculate the amount of new balance.I know I have to pares them and assign them to variables and then show them but I had some defficulty to do that.(I used as experment the first 10 text boxes as an array, to show the last names in the sequential file in these text boxes, but I couldn't)if anyone intersted in this question please send me a email and I send you my codes and what I did so far.  
Thanks,
            kami
0
Comment
Question by:kmsadr
8 Comments
 

Expert Comment

by:Badder
ID: 1444538
Ok, i'll try it.
badderp@hotmail.com
0
 

Expert Comment

by:Badder
ID: 1444539
Ok, i'll try it.
badderp@hotmail.com
0
 

Expert Comment

by:Badder
ID: 1444540
Darn!
Sorry, I was just supposed to send a comment, I made a mistake and I didn't stop at time...
Sorry...
0
 

Author Comment

by:kmsadr
ID: 1444541
It's been two days since you posted your proposed answer and I haven't heard from you. Please post the answer when you have a chance, thanks anyway,
Kami
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 2

Expert Comment

by:dm_14
ID: 1444542
send me your code and I will try to help
0
 
LVL 2

Expert Comment

by:dm_14
ID: 1444543
I can be reached at dm_14@hotmail.com
0
 
LVL 3

Expert Comment

by:Stefaan
ID: 1444544
If you want, I could take a look at it too.  E-Mail me at : lesages@my-dejanews.com
0
 
LVL 2

Accepted Solution

by:
dm_14 earned 150 total points
ID: 1444545
Paste this code in Balance.frm in Private Sub OpenmunItem_Click() just after you retrieve the file name from the common dialog.


' The Path to the file
Dim sPath As String
' Specify the location of the file
sPath = CommonDialog1.filename
' Array of First Names
ReDim sFName(1 To 1) As String
' Array of Last Names
ReDim sLName(1 To 1) As String
' Array of First Amounts
ReDim dAmount1(1 To 1) As Double
' Array of Second Amounts
ReDim dAmount2(1 To 1) As Double
' Array of Sum of First and Second Amount
ReDim dTotal(1 To 1) As Double
' Temporary line holder
Dim sLData As String
' Counter
Dim iCount As Integer

' Read Data from File
    iFnum = FreeFile
    Open (sPath) For Input As #iFnum
    While Not EOF(iFnum)
        iCount = iCount + 1
        ReDim Preserve sFName(1 To iCount)
        ReDim Preserve sLName(1 To iCount)
        ReDim Preserve dAmount1(1 To iCount)
        ReDim Preserve dAmount2(1 To iCount)
        ReDim Preserve dTotal(1 To iCount)
        Line Input #iFnum, sLData
        ' Save the First Name
        sFName(iCount) = Trim(Left$(sLData, 15))
        ' Save the Last Name
        sLName(iCount) = Trim(Mid$(sLData, 15, 16))
        ' Save the First Amount
        dAmount1(iCount) = CDbl(Trim(Mid$(sLData, 31, 10)))
        ' Save the Last Amount
        dAmount2(iCount) = CDbl(Trim(Mid$(sLData, 41, (Len(sLData) - 42))))
        ' Save the Sum of the first and second Amount
        dTotal(iCount) = dAmount1(iCount) + dAmount2(iCount)
    Wend
    Close iFnum

0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now