|
-
Aug 22nd, 2000, 01:23 PM
#1
Thread Starter
Fanatic Member
here is some code and for some reason that is beyond my control it doesn't work
Private Sub Command1_Click()
On Error Resume Next
Set fs = CreateObject("Scripting.FileSystemObject")
Set File = fs.GetFile("C:\reginfo.txt")
If Err.Number = 53 Then 'File not found
MsgBox "File Not Found"
End If
If Err.Number = 0 Then 'File found
frmsplash.Visible = True
Open "reginfo.txt" For Input As #1
frmsplash.Label1 = Input(LOF(1), 1)
Close #1
End If
End Sub
any ideas ?
it doesn't display the text from the file into label1
PLEASE HELP
Merlin ?
Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
[ Galahtech.com] | [ My Site] | [ Fishsponge] | [ UnixForum.co.uk]
-
Aug 22nd, 2000, 01:30 PM
#2
You just have reginfo.txt. Put some directory in there as well.
Try this:
Code:
Private Sub Command1_Click()
On Error Resume Next
If Dir("C:\regedit.txt") <> "" Then
frmsplash.Visible = True
Open "C:\reginfo.txt" For Input As #1
frmsplash.Label1.caption = Input(LOF(1), 1)
Close #1
Else
Msgbox "File does not exist!", 16
End If
End Sub
-
Aug 22nd, 2000, 01:38 PM
#3
Thread Starter
Fanatic Member
Hi,
i now get the message "File Does Not Exist"
any other suggestions ?
Merlin ?
Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
[ Galahtech.com] | [ My Site] | [ Fishsponge] | [ UnixForum.co.uk]
-
Aug 22nd, 2000, 01:43 PM
#4
_______
<?>
I cut and pasted your code and it worked fine for me.
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Aug 22nd, 2000, 01:50 PM
#5
Thread Starter
Fanatic Member
<annoyed> Strange
Merlin ?
Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
[ Galahtech.com] | [ My Site] | [ Fishsponge] | [ UnixForum.co.uk]
-
Aug 22nd, 2000, 01:57 PM
#6
Merlin, where is your file, reginfo.txt located?
-
Aug 22nd, 2000, 02:02 PM
#7
_______
<?>
methinks your file is empty!
if anything is in it it shows on my system
and if the file is not there it messages.
Wayne
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Aug 22nd, 2000, 02:10 PM
#8
Thread Starter
Fanatic Member
my file is situated in the c:\ (root)
and in side the file there is the following information
Dean Chapman
Help!!
Merlin ?
Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
[ Galahtech.com] | [ My Site] | [ Fishsponge] | [ UnixForum.co.uk]
-
Aug 22nd, 2000, 02:18 PM
#9
_______
<?>
other possibility...
is the backcolor of your label
the same color as the forcolor of your label
Forgive me but it is a possibility....
Does your frmSplash appear?
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Aug 22nd, 2000, 02:23 PM
#10
Try this instead:
Code:
Open "C:\regedit.txt" For Binary As #1
start$ = 1
buffer1$ = String$(10000, 0)
Get #1, start$, buffer1$
Label1.caption = Label1.caption & buffer1$
Close #1
My other suggestion, if that doesn't work, would be to load it in a text file, and then put in the Text1_Change event:
Code:
Label1.caption = Text1.text
-
Aug 22nd, 2000, 02:27 PM
#11
Thread Starter
Fanatic Member
hi, hesaidjoe
i have changed the labels back colour and this makes no difference and frmsplash does appear
mathew
no of your ways works, and i am ot sure what u are trying to do on the second one
any other suggestions
Merlin ?
[Edited by zmerlinz on 08-22-2000 at 03:29 PM]
Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
[ Galahtech.com] | [ My Site] | [ Fishsponge] | [ UnixForum.co.uk]
-
Aug 22nd, 2000, 02:34 PM
#12
_______
<?>
your code works so if you are not getting frmSplash you should be getting the message "File Not Found"
Is that happening.
At Worst...make a new project with 2 forms
the first form1 the second frmSplash
Cut and paste your original code from this post.
Open notepad and enter Help Me Out Here
Save it as C:\Reginfo
Run your program...
that is what I done and it works fine.
Wayne
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Aug 22nd, 2000, 04:01 PM
#13
Thread Starter
Fanatic Member
hi, Wayne
it still didn't work that way either
WOULD ANYONE LIKE ME TO EMAIL THEM THE PROGRAM TO SEE WHAT THEY MAKE OF IT
IT MAY HELP
Cheers
Merlin ?
Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
[ Galahtech.com] | [ My Site] | [ Fishsponge] | [ UnixForum.co.uk]
-
Aug 22nd, 2000, 04:05 PM
#14
Monday Morning Lunatic
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 22nd, 2000, 04:12 PM
#15
_______
<?>
I deleted it but I'll rebuild it and zip it for you..
Give me 15 or 20 cause I'm peeking out here at work for a moment..
Wayne
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Aug 22nd, 2000, 04:13 PM
#16
Monday Morning Lunatic
That's okay, I'll be around for a couple of hours yet.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 22nd, 2000, 04:18 PM
#17
Thread Starter
Fanatic Member
hi, parksie
i've just emailed it to you
cheers
Merlin ?
Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
[ Galahtech.com] | [ My Site] | [ Fishsponge] | [ UnixForum.co.uk]
-
Aug 22nd, 2000, 04:24 PM
#18
Monday Morning Lunatic
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 22nd, 2000, 04:31 PM
#19
_______
<?>
zmerlinz:
check your mail a working copy is there....
it's all your code
Wayne
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Aug 22nd, 2000, 04:33 PM
#20
Monday Morning Lunatic
Have a look at this:
Code:
Dim x As Object
Dim s As String
Dim sz As String
Set x = CreateObject("Scripting.FileSystemObject")
If x.FileExists("c:\autoexec.bat") Then
Open "c:\autoexec.bat" For Input As #1
While Not EOF(1)
Line Input #1, s
sz = sz + vbCrLf + s
Wend
Close #1
Debug.Print sz
Else
MsgBox "No file!"
End If
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 22nd, 2000, 04:37 PM
#21
Thread Starter
Fanatic Member
hi, wayne
it works to a certain extent, but if the file contains too much info then not all of this information is displayed
MErlin ?
Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
[ Galahtech.com] | [ My Site] | [ Fishsponge] | [ UnixForum.co.uk]
-
Aug 22nd, 2000, 04:40 PM
#22
_______
<?>
increase the size of the label
:>
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Aug 22nd, 2000, 04:42 PM
#23
Thread Starter
Fanatic Member
hi, parksie,
i like the code but why does it go to the immediate window
can it go else where ?
Merlin ?
Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
[ Galahtech.com] | [ My Site] | [ Fishsponge] | [ UnixForum.co.uk]
-
Aug 22nd, 2000, 04:48 PM
#24
Monday Morning Lunatic
I set it as:
Just use Label1.Caption = sz or otherwise.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 22nd, 2000, 04:51 PM
#25
_______
<?>
debug.print tells it to go to debug window
you can send it anywhere you want. It's basicaly the same stuff just a different color. If you change debug.print
to
frmSplash.Lable1.Caption = sz
you will get it in the label but you will still have to increase the label size to accomodate the file size.
Bye now
Wayne
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Aug 22nd, 2000, 05:01 PM
#26
Thread Starter
Fanatic Member
This Will FRY your brain
as the title says
the progrma suddenly started to work, when i changed the text in the file, it still displayed the original text (how i don't know), then i tryied again and now it has gone back to not working
AAAAAAAGGGGGGGGHHHHHHHHHHHHH!!!!!
Merlin ?
Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
[ Galahtech.com] | [ My Site] | [ Fishsponge] | [ UnixForum.co.uk]
-
Aug 22nd, 2000, 05:10 PM
#27
Thread Starter
Fanatic Member
thankyou parksie thanks to your suggestion and a little messing about i have finally got it working
i bow down to you, and praise you as a Vb God
Thanks Millions
and thanks to wayne as well
cheers
Merlin ?
Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
[ Galahtech.com] | [ My Site] | [ Fishsponge] | [ UnixForum.co.uk]
-
Aug 22nd, 2000, 05:13 PM
#28
Monday Morning Lunatic
and praise you as a Vb God
...Guru will do nicely...
Glad to have helped!
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|