Results 1 to 12 of 12

Thread: Function in module is not being called

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    350

    Function in module is not being called

    I have the following statement and the function 'InitialiseOsTransform' is in a Module which is in the project.

    Code:
    If InitialiseOsTransform() = False Then
    But instead of the code going into this function it goes into the Paint function.

    I have used the similar code in another project and it works correctly. I'm confused. What is going on?

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

    Re: Function in module is not being called

    It would help if you posted some more of the relevant code, or if possible upload the project as a zip file. Without that nobody could make anything out of the single line.

    .
    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!

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    350

    Re: Function in module is not being called

    The project is large and it would be difficult to cut down to show this problem.
    I wondered if anyone had any idea why the function was not being called.
    Thanks.

  4. #4
    Addicted Member
    Join Date
    Jan 2011
    Posts
    132

    Re: Function in module is not being called

    Have you tried to step through the code and see what is being returned from the module function ?

    Maybe you could post the InitialiseOsTransform() function so we can see whats happening ? because as Honeybee said without seeing what is happening we cant really help.

  5. #5
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    Re: Function in module is not being called

    Its possible you have asked to step-over properties and operators, checkout this link to make sure you have it turned off (you can do it just for that line however, if your right-click it!).

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    350

    Re: Function in module is not being called

    When I ste[p through the code it gets to this statement but doesn't go into the function - this is what is strange.

  7. #7
    Addicted Member
    Join Date
    Jan 2011
    Posts
    132

    Re: Function in module is not being called

    Are you sure that the function is returning something ? If possible please post the module InitialiseOsTransform() or that the previous line is not making it skip past this function ?

  8. #8
    Hyperactive Member Aash's Avatar
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    491

    Re: Function in module is not being called

    Can you post the code of those two functions?, you've mentioned above.
    if you do post your code I can get some learning from it too

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    350

    Re: Function in module is not being called

    I looked for the 'Step over properties' - but I have the express edition so this isn't available.

  10. #10
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    Re: Function in module is not being called

    Put a breakpoint on the first line within that method.

  11. #11

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    350

    Re: Function in module is not being called

    I did have a breakpoint on the first line of the function.

    Thanks for all your suggestions.
    I have taken the project that was working calling that function, copied and renamed the project, stripped out all the bits I didn't need and it is working. I'm therefore going to use that project and scrap the project that wasn't working.
    Thanks for your advice.

  12. #12
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    Re: Function in module is not being called

    Was the function in another module in a different project (you have not mentioned that it was) ? If it was, possbily the other project is not being compiled in debug mode, or you have not setup the project dependency correctly.

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