What is the VB6 code to print the contents of a textbox out to a *.txt (Notepad) file on the click of a cmd? This is done in both AITE and in CFSMe, some of you may know them.
Thanks, Dan G
Option Explicit
Private Sub cmdPrint_Click()
'define some variables we'll need
Dim fno1 As Integer
Dim fno2 As Integer
Dim inarea As String
'open the template file for reading
fno1 = FreeFile
Open "C:\Aafamily\Daniel\CFS World\ReadMe!.txt" For Input As #fno1
'open the output file for writing
fno2 = FreeFile
Open "C:\Aafamily\Daniel\CFS World\ReadMe!.txt" For Output As #fno2
'copy front of template to output
Line Input #fno1, inarea
Do While inarea <> "insert here"
Print #fno2, inarea
Line Input #fno1, inarea
Loop
'write text box contents to output file
Print #fno2, text1.Text
'copy back of template to output
Do While Not EOF(fno2)
Line Input #fno1, inarea
Print #fno2, inarea
Loop
'close both files
Close fno1
Close fno2
End Sub
16 May 2003
TURN WORD WRAP ON
------------------------------------The P47 Funderbolt by Dan Garner-----------------------------------------
This aircraft was worked on entirely from stock by Dan Garner. It has been re-painted to a semi-real Thunderbolt from RAF Duxford. The *Air file (Flight Characteristics) has been drastically modified to make it a fully aerobatic aircraft. The damage profile (*dp) has been altered as well to take the P51 Mustang profile.
----------------------------------------------------Installation--------------------------------------------------------------
For those amongst you who don't know (!), here are some brief installation instructions:
Having unzipped this file to a suitable directory, for example 'C:/Myfiles', (NOT CFS), make yourself familiar with the CFS directories. It should look something like: 'C:/MicrosoftGames/CombatFlightSimulator/Aircaft' If it does not compare exactly, don't worry! Just copy the 'Funderbolt' folder in 'C:/Myfiles' to the 'Aircraft' folder in CFS. Fire up the simulator, and on the aircraft menu it will show up as 'P47 Funderbolt'.
This aircraft has been designed especially for the original Combat Flight Simulator (Europe Series) (CFS1). It has NOT been tested on any other systems.
PLEASE NOTE: With some different size monitors the panel 'windows' may apear blacked out. Just exit the CFS and open the file called 'Panel_Background_1024' in 'CFS/Aircraft/Funderbolt/Panel' and paint the top left few pixels TRUE black. Save, close the file and start the sim. You should now see out of the windows.
------------------------------------------------------Declarations----------------------------------------------------------
I would like to thank a few people for their help and contribution towards my project:-
William Roth - For his excellent freeware 'AirEd'
Simviation Forum's - For all of the members's help for me when I had problems
Simviations 'Lair' - The 'Lair' helped me a lot through many little problems
Above all, thank you to Simviation, without whom I would never have done this!
I TAKE ABSOLUTEY NO RESPONSIBILITY FOR ANY DAMAGE TO FILES OR OTHER PROBLEMS CAUSED BY THESE FILES. Any other designers may take this design on provided that:
NO profit is taken - this is freeware, it MUST stay that way.
Credit is given to me where required.
-------------------------------------------------Contact Me----------------------------------------------------------------
Please let me know about any constructive thoughts you have, by sending me an Instant Message on the Simviation forum. Please don't send me hate mail. My username is: Dan
Return to Computer Games & Software
Users browsing this forum: No registered users and 488 guests