Results 1 to 12 of 12

Thread: Mental retardation

  1. #1

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935

    Mental retardation

    I get this error when trying to Run with Full Compile or compile my project:



    What...the...hell.

    Project attached in next post.
    Attached Images Attached Images  

  2. #2

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935
    Project:
    Attached Files Attached Files

  3. #3
    New Member petejc21's Avatar
    Join Date
    Jun 2002
    Location
    In a house, Kent, England
    Posts
    10

    ..

    I opened your project and I got the same error gawd knows what it is but its obviously the project, not your installation of VB.

  4. #4
    New Member petejc21's Avatar
    Join Date
    Jun 2002
    Location
    In a house, Kent, England
    Posts
    10
    I removed the module and tried it and it ran okay, I assume its somethng in there?

  5. #5

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935
    It's something wrong with this:
    VB Code:
    1. Public Function MakeURL(Suffix As String, Optional Hostname As String = ServerSettings.Address, _
    2.         Optional Port As Integer = ServerSettings.Port, _
    3.         Optional Path As String = ServerSettings.Path) As String
    4.     MakeURL = "http://" & Hostname.Address & IIf(Port = "80", "", ":" & Port) & Path & Suffix
    5. End Function
    So, what's wrong with that?

  6. #6
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    sure it's from the code?! try running it by F8, it wont even run a single line of code to get that error

    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  7. #7
    Hyperactive Member Hampster's Avatar
    Join Date
    Feb 2001
    Location
    On my hamster wheel.
    Posts
    374
    Something's wrong with your ServerSettings delcaration I guess... If your try debug.print ServerSettings.Port (or any member of ServerSettings) it does the same error.

    Visual Basic searches backward in the calls list to execute the first enabled error handler it finds. If not, it presents a default unexpected error message and halts execution.
    Last edited by Hampster; Jun 25th, 2002 at 02:14 PM.

  8. #8

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935
    Originally posted by Hampster
    Something's wrong with your ServerSettings delcaration I guess... If your try debug.print ServerSettings.Port (or any member of ServerSettings) it does the same error.

    It's something wrong with it. I took out references to it in that function and it ran at least, so the investigation continues...

  9. #9
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    Originally posted by filburt1
    It's something wrong with this:
    VB Code:
    1. Public Function MakeURL(Suffix As String, Optional Hostname As String = ServerSettings.Address, _
    2.         Optional Port As Integer = ServerSettings.Port, _
    3.         Optional Path As String = ServerSettings.Path) As String
    4.     MakeURL = "http://" & Hostname.Address & IIf(Port = "80", "", ":" & Port) & Path & Suffix
    5. End Function
    So, what's wrong with that?
    Why are you using HostName.Address, where the Hostname is a string?

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  10. #10

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935
    I saw that as I posted it and fixed it, but it didn't make a difference.

    This seems to work but I like the original function much better:
    VB Code:
    1. Public Function MakeURL(Suffix As String, Optional hostname As String, Optional port As Long, _
    2.          Optional path As String) As String
    3.     If hostname = Empty Then hostname = ServerSettings.Address
    4.     If port = 0 Then port = ServerSettings.port
    5.     If path = Empty Then path = ServerSettings.path
    6.    
    7.     MakeURL = "http://" & hostname & IIf(port = "80", "", ":" & port) & path & Suffix
    8. End Function

  11. #11
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    When I try to open your project, I get an error about some ActiveX control not registered.

    When I open the BAS file alone and press F5, I get an Unexpected error. When I comment out the MakeURL function, VB proceeds correctly to tell me there's no startup object.

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  12. #12
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    Here you go:

    In the declaration of the MakeURL, simply declare the optional arguments as optional, and don't assign them any values.

    VB Code:
    1. Public Function MakeURL(Suffix As String, Optional Hostname As String, _
    2.         Optional Port As Long, _
    3.         Optional Path As String) As String
    4.     MakeURL = "http://" & Hostname & IIf(Port = "80", "", ":" & Port) & Path & Suffix
    5. End Function

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

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