|
|
 |
| |
Terms of Agreement:
By using this article, you agree to the following terms...
1) You may use
this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame.
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.
|
Public Sub file2list(listbox As listbox, filename As String, clear As String)
'Open in listbox script by Gamer931215
'ussage: as example you want to open c:\
' text.txt in list1, use openlist list1,"C
' :\text.txt", 0
'if you want to clear your list first an
' d then open a file replace the '0' with
' a '1'!
If clear = "1" Then
listbox.clear
End If
Dim temp1 As String
Dim temp2 As String
temp1 = "0"
temp2 = "0"
Dim data As String
Open filename For Input As #1
On Error GoTo handler
Do Until temp1 = "999999999999999" 'rules to read
Input #1, data 'open data
temp1 = temp1 + 1 'counter
temp2 = data 'read data in temp
listbox.AddItem temp2 'add data
Loop
Exit Sub
handler:
Close #1
End Sub
| |
|
|
| |
Report Bad Submission |
|
| |
| Your Vote! |
|
See Voting Log |
| |
| Other User Comments |
11/4/2009 7:58:04 AM: Edy Hermanson Simarmata
thank you!! (If this comment was disrespectful, please report it.)
|
|
|
Add Your Feedback! |
Note:Not only will your feedback be posted, but an email will be sent to the code's author from the email account you registered on the site, so you can correspond directly.
NOTICE: The author of this article has been kind enough to share it with you. If you have a criticism, please state it politely or it will be deleted.
For feedback not related to this particular article, please click here. |
To post feedback, first please login. |