PDA

View Full Version : Omg!



Diabloizzle
08-10-2007, 03:25 AM
All these questions....actually just one to start...
I can save/open/create .bin files...but thats all i can do (conserning files). How do i open/save/create regular files...not .bin or anything...I've been experimenting and cant find anything that works...Plz help! (and tell me if you have no idea what im talking about...):spot:

Miitchyy
08-10-2007, 11:18 AM
Open "C:\FileName.EXTENSION" for Output as #1
Print #1, "Hi"
Close #1

Is that what you mean?

JuKKa
08-10-2007, 07:17 PM
Open "C:\FileName.EXTENSION" for Append as #1
Print #1, "Hi"
Close #1

Append it over writes the file.

Miitchyy
08-11-2007, 12:19 AM
Dim Data As String
Open "C:\FileName.EXTENSION" For Input As #1
Do Until EOF(1)
Input #1, Data 'Gets 1 line of text/data from the file (Use: txtMain.Text = txtMain.Text & Data)
EOF(1)
Loop
Close #1

Diabloizzle
08-12-2007, 12:51 AM
Thank you soooo much all of you guys!!!:D
Hey kevin wolf...one more question... when you said
'Gets 1 line of text/data from the file (Use: txtMain.Text = txtMain.Text & Data)...does that mean i can store multiple variables in one txt file and read it line by line(like an End of Line insteaad of End of file?)? Or do i need to use another format...like the delimeated txt file or something like that? thanks!!

shaunthasheep
08-13-2007, 03:44 PM
you can read it one by one using Input.

Miitchyy
08-14-2007, 10:46 AM
It gets each line because windows doesnt saves Enters :P
So what my post should say is "Use: txtMain.Text = txtMain.Text & Data & vbNewLine" :P

EDIT: Woot, 100 posts.

Diabloizzle
08-25-2007, 04:49 AM
Okay, so no one is probably looking at this thread anymore but,
Thanks Kevin Wolf for all the great help!! I have one more question...there is always another question...
I still dont understand that reading it line by line part. What i want to do is make each line of the txt file (they are all integers) so it would be like:

67
34
23

how do i make it so i can make each line a different variable...like: x = 67, y = 34, and z = 23?

Thanks for all your help guys! (im starting to feel like im asking too many questions...)

p.s.--dont worry...vb isnt the only thing i do in my life....im trying to learning scar too..;)

jhildy
08-25-2007, 06:46 AM
Open "C:\FileName.EXTENSION" for Append as #1
Print #1, "Hi"
Close #1

Append it over writes the file.

doesn't append add on to and output overwrites?

Diabloizzle
08-27-2007, 07:38 PM
Yes it does. I found that out. But i still do not understand how to get different varriables from one txt file by reading it line by line. Is there a way to specify which line i want to read? thanks.

Is there a way to detect if a certain web page is open with visual basic 6.0? So lets say i want to constantly check if http://www.runescape.com/ is open. I'm guessing i would use a timer set as "1" and then the code. Does anyone know what that code might be? I've looked on google but i have no idea what to try. (i usually type in code snippets that i know to get something)

also, i am still wondering how to read specific lines of a vb saved txt file. Thanks.


(sorry bout the double post/bump... i dont know how long of a wait a thread gets before its considered bumping it, i kinda got in trouble with that before... and the double post is only because i thought that this was a different question than my previous unanswered one..wink wink...) :)

AH-HEM! My previous question? I'm just thinking... if you don't want to answer just tell me! don't leave me hanging! (really guys..this is the internet, i click one button and my post is up there. No line to stand in...)