Solved

Something wrong with Input #

Posted on 1998-06-04
2
127 Views
Last Modified: 2010-05-03
I'm trying to load a file into a textbox, but the file doesn't look like I want (as in Notepad). Here is my code:

    iFile = FreeFile
    Open sPath$ For Input As iFile%
    Do Until EOF(iFile%)
        Input #iFile%, sText$
        sReturn$ = sReturn$ & sText$ & Chr(13) & Chr(10)
    Loop
    Close #iFile%

First, all the indentations disappears (i.e. space characters). This app is about source code, so I really need the indentations. How can I transfer them to a standard textbox in VB?

Second, the comma character (ASCII 44) convert into a carriage return/linefeed sequence! Why? What can I do about it?

Regards, Gustaf Liljegren
0
Comment
Question by:liljegren
2 Comments
 
LVL 4

Accepted Solution

by:
martinag earned 100 total points
ID: 1462543
Use Line Input:
Line Input #iFile%, sText$

This reads the whole line instead of stopping at the first comma or ".
0
 

Author Comment

by:liljegren
ID: 1462544
Easy, but excellent! :-)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…

705 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

19 Experts available now in Live!

Get 1:1 Help Now