Results 1 to 28 of 28

Thread: Where is the Problem ????????????

  1. #1

    Thread Starter
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604

    Question

    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]

  2. #2
    Guest
    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

  3. #3

    Thread Starter
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604
    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]

  4. #4
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    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

  5. #5

    Thread Starter
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604
    <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]

  6. #6
    Guest
    Merlin, where is your file, reginfo.txt located?

  7. #7
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    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

  8. #8

    Thread Starter
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604
    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]

  9. #9
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    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

  10. #10
    Guest
    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

  11. #11

    Thread Starter
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604
    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]

  12. #12
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    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

  13. #13

    Thread Starter
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604
    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]

  14. #14
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    I'll look. [email protected]
    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

  15. #15
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    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

  16. #16
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  17. #17

    Thread Starter
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604
    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]

  18. #18
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Thanks, got it.
    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

  19. #19
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    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

  20. #20
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  21. #21

    Thread Starter
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604
    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]

  22. #22
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    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

  23. #23

    Thread Starter
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604
    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]

  24. #24
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    I set it as:
    Code:
    Debug.Print sz
    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

  25. #25
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    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

  26. #26

    Thread Starter
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604

    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]

  27. #27

    Thread Starter
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604
    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]

  28. #28
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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
  •  



Click Here to Expand Forum to Full Width