Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old October 23rd, 2004, 03:43 AM
Arjun Arjun is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 43 Arjun User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 m 18 sec
Reputation Power: 4
Writing to a text file

Can any one tell how to write texts to textfiles (notepad), using API or anyway.... please

Reply With Quote
  #2  
Old October 24th, 2004, 08:43 PM
JamesLe JamesLe is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: Oakland, CA, USA
Posts: 131 JamesLe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m
Reputation Power: 4
RE: Writing to a text file

Hello Arjun,

Look in Help for more information about OPEN, CLOSE, PRINT # and WRITE # Statements. Below is the sample code.

'------------------------------------------------------
Open "c:\test.txt" For Output As #1 ' Open file for output.
Write #1, "Hello World", 234 ' Write comma-delimited data.
Write #1, ' Write blank line.
Close #1 ' close file
'------------------------------------------------------

Reply With Quote
  #3  
Old October 24th, 2004, 10:03 PM
Arjun Arjun is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 43 Arjun User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 m 18 sec
Reputation Power: 4
Hi JamesLe,

Thank You so much..

Actually i dont have MSDN help, where i can get the help for these syntaxes like, #1, output etc...
How to specify append mode write mode, read only ....?

Arjun....

Reply With Quote
  #4  
Old October 24th, 2004, 10:06 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 18 h 33 m 48 sec
Reputation Power: 180
http://msdn.microsoft.com/library
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #5  
Old October 24th, 2004, 10:14 PM
Arjun Arjun is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 43 Arjun User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 m 18 sec
Reputation Power: 4
Thanx

hi Doug G!

thanx..

Reply With Quote
  #6  
Old October 25th, 2004, 12:01 AM
aweehan aweehan is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 5 aweehan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi, here's a sample of my code. It seemed to work for me.

While Not EOF(1)
Line Input #1, Eachline
splitline = Split(Eachline, Chr(9))
For i = 0 To UBound(splitline)
x = i + 1
mtt(x, y) = Val(splitline(i))
Next
y = y + 1
Wend

Reply With Quote
  #7  
Old October 25th, 2004, 11:50 PM
Arjun Arjun is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 43 Arjun User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 m 18 sec
Reputation Power: 4
Whats wrong in my code

Hi!
any one tell what is wrong in this code..?

Private Sub Command1_Click()

Dim mtt() As String

Open "c:\test2.txt" For Input As #1 ' Open file for output.

While Not EOF(1)
Line Input #1, Eachline
splitline = Split(Eachline, Chr(9))
For i = 0 To UBound(splitline)
x = i + 1
mtt(x, y) = Val(splitline(i))
Next
y = y + 1
Wend

Close #1 ' close file

MsgBox mtt(0, 0)


End Sub

Reply With Quote
  #8  
Old October 26th, 2004, 11:35 AM
JamesLe JamesLe is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: Oakland, CA, USA
Posts: 131 JamesLe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m
Reputation Power: 4
RE: Declaring an Array

Hello Arjun,

Look like you have a problem with your array declaration. If it is a dynamic array then you need to add ReDim statement to specify the array size at runtime. Look in help for more info about Dim and ReDim statement and Preserve keyword. Hope it helps.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Writing to a text file


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway