What's Here?
- Members: 149,625
- Replies: 506,753
- Topics: 79,851
- Snippets: 2,666
- Tutorials: 706
- Total Online: 1,978
- Members: 76
- Guests: 1,902
|
Fast way to read and write to/from file.
|
Submitted By: m2s87
|
|
Rating:
|
|
Views: 6,076 |
Language: Visual Basic
|
|
Last Modified: January 4, 2007 |
Instructions: data=sisu_s(where_from)
noproblems=sisu_s(where_from,data)
You can test it with code like:
If sisu_v("C:/bling.txt", "The content of this file is in C:/bling.txt") = True Then
MsgBox (sisu_s("C:/bling.txt"))
End If |
Snippet
Function sisu_s(nimi$, Optional arv% = 1) As String
Open nimi$ For Input As #arv
sisu_s = Input$(LOF(arv), arv)
Close #arv
End Function
Function sisu_v(nimi$, sisu$, Optional arv% = 2) As Boolean
sisu_v = True
Open nimi$ For Output As #arv
Print #arv, sisu
Close #arv
Exit Function
viga: sisu_v = False
End Function
Copy & Paste
|
|
|
Be Social
Reference Sheets
Bye Bye Ads
Monthly Drawing
Top Contributors
Top 10 Kudos This Month
|