Link to home
Start Free TrialLog in
Avatar of liljegren
liljegrenFlag for Sweden

asked on

Something wrong with Input #

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
ASKER CERTIFIED SOLUTION
Avatar of martinag
martinag

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of liljegren

ASKER

Easy, but excellent! :-)