SRL Archive - C#/Visual Basic Help and Tutorials

Omg!


Diabloizzle

2007-08-09 23:25:23

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

2007-08-10 07:18:20

Open "C:\FileName.EXTENSION" for Output as #1
Print #1, "Hi"
Close #1

Is that what you mean?

JuKKa

2007-08-10 15:17:46

Open "C:\FileName.EXTENSION" for Append as #1
Print #1, "Hi"
Close #1

Append it over writes the file.

Miitchyy

2007-08-10 20:19:27

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

2007-08-11 20:51:09

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

2007-08-13 11:44:04

you can read it one by one using Input.

Miitchyy

2007-08-14 06:46:17

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

2007-08-25 00:49:58

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

2007-08-25 02:46:55

From: JuKKa
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

2007-08-27 15:38:39

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…)