Results 1 to 8 of 8

Thread: procedurename in string

  1. #1

    Thread Starter
    Fanatic Member robbedaya's Avatar
    Join Date
    Jul 2002
    Location
    Belgium
    Posts
    872

    Question procedurename in string

    is it possible to get the name of a sub or function in runtime.

    I would like to use this in errorhandling, so i could log the sub-name or functionname to file.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: procedurename in string

    Quote Originally Posted by robbedaya
    is it possible to get the name of a sub or function in runtime.

    I would like to use this in errorhandling, so i could log the sub-name or functionname to file.
    No. Each of your sub/function names will have to be written into your error traps in design.

  3. #3
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: procedurename in string

    well, u can check which module is being called/executed at a given instance of time.
    just include a messagebox in all the procedures saying "You are in Module n - Procedure P()" so you will know about the current position of the compiler.

    PS - sorry if i misunderstood your question
    Show Appreciation. Rate Posts.

  4. #4
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: procedurename in string

    robbedaya,

    Take a look at *******. It can put that tyoe of error code in all of your modules at once. MZ-Tools can sort of do it one routine at a time.
    Last edited by randem; Oct 26th, 2005 at 04:50 AM.

  5. #5

    Thread Starter
    Fanatic Member robbedaya's Avatar
    Join Date
    Jul 2002
    Location
    Belgium
    Posts
    872

    Re: procedurename in string

    thanks for your replies. But the answers you are giving is what i want to avoid.

    I would like to know the procedure name without typing it myself.
    Is there a function that returns the name of the current procedure.

    Does anything exist like:

    VB Code:
    1. msgbox "an error occured in " & GetCurrentprocedureName

  6. #6
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: procedurename in string

    robbedaya,

    I gave you the only way to do it besides typing it yourself. And no you cannot do it that way.

  7. #7
    Addicted Member Redangel's Avatar
    Join Date
    Oct 2005
    Location
    England
    Posts
    214

    Re: procedurename in string

    is this kinda what your after :

    Dim slnfo as string
    'display the information
    slnfo = "Now Dragging."
    slnfo = slnfo + source.Tag
    slnfo = slnfo + "Over The Form."
    slnfo = slnfo + "State ="
    slnfo = slnfo + Str$(State)
    txtinfo.Text = slnfo

    Forgive me if i did'nt understand!!!! RedAngel

  8. #8

    Thread Starter
    Fanatic Member robbedaya's Avatar
    Join Date
    Jul 2002
    Location
    Belgium
    Posts
    872

    Re: procedurename in string

    Quote Originally Posted by randem
    robbedaya,

    I gave you the only way to do it besides typing it yourself. And no you cannot do it that way.
    oké. thanks.

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