What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » create a .txt file through VB

Pages: (2): « First [ 1 ] 2 » Last »
create a .txt file through VB
Author: Message:
_BassReFLeX_
Junior Member
**

Avatar

Posts: 56
– / Male / –
Joined: Dec 2003
O.P. create a .txt file through VB
Hi there.

hmm. Can anyone help me with something in vb ?...

I would like to know how could I make a text (.txt) file... e.g

txttextinside.text -> text.txt

hm... I've read few tutorials about this but still can't find what I'm looking for .. :P

thnx:)
:)
05-18-2004 02:36 PM
Profile E-Mail PM Find Quote Report
Stigmata
Veteran Member
*****



Posts: 3520
Reputation: 45
20 / Other / Flag
Joined: Jul 2003
RE: create a .txt file through VB
put into a button or something
code:
open "eatme.txt" For append as 1
print #1, text1.text
close 1


if something is not there, vb automaticly creates it :)

edit :
more advance version
code:
Private Sub Command1_Click()
   Open "C:\Text.txt" For Ouput As #1
     Print #1,
Text1.Text
   Close #1
End Sub

This post was edited on 05-18-2004 at 02:43 PM by Stigmata.
05-18-2004 02:42 PM
Profile PM Web Find Quote Report
_BassReFLeX_
Junior Member
**

Avatar

Posts: 56
– / Male / –
Joined: Dec 2003
O.P. RE: create a .txt file through VB
hell. thank you jw . thanks a lot m8 ;)
:)
05-18-2004 02:45 PM
Profile E-Mail PM Find Quote Report
Stigmata
Veteran Member
*****



Posts: 3520
Reputation: 45
20 / Other / Flag
Joined: Jul 2003
RE: create a .txt file through VB
thats ok :)
05-18-2004 03:03 PM
Profile PM Web Find Quote Report
Mike
Elite Member
*****

Avatar
Meet the Spam Family!

Posts: 2795
Reputation: 48
31 / Male / Flag
Joined: Mar 2003
Status: Online
RE: create a .txt file through VB
BassReFlex...
You can try asking your vb questions at http://www.vbforums.com
I dont say that members here at the MsgPlus! forums here dont know vb but i think VBF is a better place to ask your VB questions.
Im there too :)
YouTube closed-captions ripper (also allows you to download videos!)
05-18-2004 03:08 PM
Profile E-Mail PM Web Find Quote Report
Stigmata
Veteran Member
*****



Posts: 3520
Reputation: 45
20 / Other / Flag
Joined: Jul 2003
RE: create a .txt file through VB
why? we have good programmers here :P
05-18-2004 03:11 PM
Profile PM Web Find Quote Report
_BassReFLeX_
Junior Member
**

Avatar

Posts: 56
– / Male / –
Joined: Dec 2003
O.P. RE: create a .txt file through VB
btw... how do i rewrite the same .txt file.. but not OVERWRITE just continue in blank lines .... :o
:)
05-19-2004 11:10 AM
Profile E-Mail PM Find Quote Report
Mike
Elite Member
*****

Avatar
Meet the Spam Family!

Posts: 2795
Reputation: 48
31 / Male / Flag
Joined: Mar 2003
Status: Online
RE: create a .txt file through VB
You can read the data in the text before appending and then make a temp string and do: TempString = String1 & String2
If you want i can post an example :)

Also if you have time then register at VBF and ask your questions there :)

This post was edited on 05-19-2004 at 11:23 AM by Mike.
YouTube closed-captions ripper (also allows you to download videos!)
05-19-2004 11:18 AM
Profile E-Mail PM Web Find Quote Report
Dempsey
Scripting Contest Winner
*****

Avatar
http://AdamDempsey.net

Posts: 2395
Reputation: 53
37 / Male / Flag
Joined: Jul 2003
RE: RE: create a .txt file through VB
quote:
Originally posted by _BassReFLeX_
btw... how do i rewrite the same .txt file.. but not OVERWRITE just continue in blank lines .... :o

dim filenum as integer
filenum= freefile

Open "C:\Text.txt" For Append As filenum
Print filenum, Text1.Text
Close filenum

use append if you want to add to the file and output to rewrite it

This post was edited on 05-19-2004 at 01:42 PM by Dempsey.
SoundPacks   -   Scripts   -   Skins

that's not a bug, thats an unexpected feature
05-19-2004 01:40 PM
Profile E-Mail PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: create a .txt file through VB
code:
'This will write to the text file
Open <Path Of File> for Append As #1
Print #1, Text1.Text
Close #1

'This will read the text file
Dim strTextFile As String
Open <Path Of File> for Input as #1
   Do Until EOF(1)
     Input#1,strTextFile
     Text1.Text=Text1.Text & strTextFile & vbnewline
   Loop
Close #1

'This will clear the text file
Open <Path Of File> For Output As #1
Close #1

'OR

Kill <Path Of File>



It is easiest to use the vb Function App.Path & "\Whatever.txt"

That means that the text file you are looking for is in the same place as the exe, its a lot easier then specifing an exact path because what happens if they install the application to another place :)

This post was edited on 05-19-2004 at 01:46 PM by matty.
05-19-2004 01:46 PM
Profile E-Mail PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On