Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Equivalent of these Macros in C#

Equivalent of these Macros in C#

Scheduled Pinned Locked Moved C#
csharpc++visual-studiocom
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mushtaque Nizamani
    wrote on last edited by
    #1

    There are some predefined macros in C++! __FILE__ : The name of the current source file. it expands to a string surrounded by double quotation marks. __LINE__ : The line number in the current source file. The line number is a decimal integer constant. It can be altered with a #line directive. List of these macros can be found at. http://msdn2.microsoft.com/en-us/library/b0084kay(VS.71).aspx[^] Can any one please tell the equivalent of these macros in C#.

    Best Regards, Mushq Mushtaque Ahmed Nizamani Software Engineer Ultimus Pakistan

    H T 2 Replies Last reply
    0
    • M Mushtaque Nizamani

      There are some predefined macros in C++! __FILE__ : The name of the current source file. it expands to a string surrounded by double quotation marks. __LINE__ : The line number in the current source file. The line number is a decimal integer constant. It can be altered with a #line directive. List of these macros can be found at. http://msdn2.microsoft.com/en-us/library/b0084kay(VS.71).aspx[^] Can any one please tell the equivalent of these macros in C#.

      Best Regards, Mushq Mushtaque Ahmed Nizamani Software Engineer Ultimus Pakistan

      H Offline
      H Offline
      Hoss Fly
      wrote on last edited by
      #2

      Unfortunately, there are no direct macro equivalents in C#. However, you might find some alterantives here with StackFrame or StackTrace (Debug): http://www.dotnet247.com/247reference/msgs/1/8826.aspx[^] HossFly

      1 Reply Last reply
      0
      • M Mushtaque Nizamani

        There are some predefined macros in C++! __FILE__ : The name of the current source file. it expands to a string surrounded by double quotation marks. __LINE__ : The line number in the current source file. The line number is a decimal integer constant. It can be altered with a #line directive. List of these macros can be found at. http://msdn2.microsoft.com/en-us/library/b0084kay(VS.71).aspx[^] Can any one please tell the equivalent of these macros in C#.

        Best Regards, Mushq Mushtaque Ahmed Nizamani Software Engineer Ultimus Pakistan

        T Offline
        T Offline
        TJoe
        wrote on last edited by
        #3

        Check out this[^] and this[^] (search for __FILE__ in this link).

        Take care, Tom ----------------------------------------------- Check out my blog at http://tjoe.wordpress.com

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups