School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!
You're Browsing As A Guest! Register Now...
Become an Expert!

Join 357,971 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,550 people online right now.Registration is fast and FREE... Join Now!



create text file

52 Weeks of Code Challenge: Android

Week #11 of the 52 Weeks of Code Challenge is Android, you should give it a shot. Click Here!

create text file please give me the code to create a text file in vb Rate Topic: -----

#1 resmy ravi  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 04-November 09


Dream Kudos: 0

Posted 04 November 2009 - 10:43 PM

please give me the code to create a text file in vb
Was This Post Helpful? 0
  • +
  • -


#2 bytelogik  Icon User is offline

  • D.I.C Head
  • PipPip

Reputation: 7
  • View blog
  • Posts: 92
  • Joined: 06-October 09


Dream Kudos: 0

Re: create text file

Posted 04 November 2009 - 11:21 PM

Here you are:

This example illustrates various uses of the Open statement to enable input and output to a file.

The following code opens the file TESTFILE in sequential-input mode.
Change the TESTFILE with you text file path and name : example: "c:\something.txt"

Open "TESTFILE" For Input As #1
' Close before reopening in another mode.
Close #1


This example opens the file in Binary mode for writing operations only.

Open "TESTFILE" For Binary Access Write As #1
' Close before reopening in another mode.
Close #1


The following example opens the file in Random mode. The file contains records of the user-defined type Record.

Type Record ' Define user-defined type.
ID As Integer
Name As String * 20
End Type

Dim MyRecord As Record ' Declare variable.
Open "TESTFILE" For Random As #1 Len = Len(MyRecord)
' Close before reopening in another mode.
Close #1


This code example opens the file for sequential output; any process can read or write to file.

Open "TESTFILE" For Output Shared As #1
' Close before reopening in another mode.
Close #1


This code example opens the file in Binary mode for reading; other processes cannot read file.

Open "TESTFILE" For Binary Access Read Lock Read As #1
Was This Post Helpful? 0
  • +
  • -

#3 NoBrain  Icon User is online

  • BIG-DIC
  • Icon

Reputation: 71
  • View blog
  • Posts: 1,809
  • Joined: 25-March 09


Dream Kudos: 425

Re: create text file

Posted 05 November 2009 - 01:53 AM

we usual don`t give like this codes but we have nice tutorial & snipped section you can take a look at :)
Was This Post Helpful? 0
  • +
  • -



Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month