473,406 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

__LINE__ and __PATH__ function.

Sky
In PHP there is a way of finding your current location in the file structure
with the __LINE__ and __PATH__ special commands.

Comes in handy for debugging, as well as relative pathing when making
websites.

I assume that being compiled __LINE__ makes no sense in C# asp.net, but
__PATH__ still would. Is there such a beast?

Thanks!
Nov 15 '05 #1
2 2350
You could use the StackFrame class to get such an information

José

"Sky" <fo****@xact-solutions.com> wrote in message
news:Oe*************@TK2MSFTNGP09.phx.gbl...
In PHP there is a way of finding your current location in the file structure with the __LINE__ and __PATH__ special commands.

Comes in handy for debugging, as well as relative pathing when making
websites.

I assume that being compiled __LINE__ makes no sense in C# asp.net, but
__PATH__ still would. Is there such a beast?

Thanks!

Nov 15 '05 #2
Sky
Ok. Sounds good. But the StackFrame class provides strings of the Functions
and Classes I am in, not the path.

I'm thinking more in line of if within an "\Controls\control.ascx" that I
can find out that I am in the Controls dir so that I can decide how many
"..\" to prepend to it to nav to where I want to go.

PS: Yes, I know about the "~" directive for the root dir -- just want to
know if there is another way.

Thanks!

"José Joye" <jo*******@KILLTHESPAMSbluewin.ch> wrote in message
news:uS**************@TK2MSFTNGP10.phx.gbl...
You could use the StackFrame class to get such an information

José

"Sky" <fo****@xact-solutions.com> wrote in message
news:Oe*************@TK2MSFTNGP09.phx.gbl...
In PHP there is a way of finding your current location in the file

structure
with the __LINE__ and __PATH__ special commands.

Comes in handy for debugging, as well as relative pathing when making
websites.

I assume that being compiled __LINE__ makes no sense in C# asp.net, but
__PATH__ still would. Is there such a beast?

Thanks!


Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Spry | last post by:
Hi, I wanted to write macros for finding the number of memory allocations and deallocations also wanted to find the locations. The code I have is a pretty big one. I have a wrapper on top of...
18
by: Paul Shipley | last post by:
Hi, Does anyone know a way of converting the __LINE__ macro to a string at compile time? The reason I ask it because I want to put some debug information in to tell me if memory is not being...
5
by: jake1138 | last post by:
I couldn't find an example of this anywhere so I post it in the hope that someone finds it useful. I believe this is compiler specific (I'm using gcc), as C99 defines __VA_ARGS__. Comments are...
5
by: Carlos | last post by:
I have a macro #define DIE(msg) do { fprintf(stderr, "%s (l.%d)\n", msg, __LINE__);\ exit(1); }\ while (0) and it works :). But later I thought, that if I use it like this: s =...
9
by: Francois Grieu | last post by:
Hello, I wrote this: #define M(x) enum { m##__LINE__ = x }; #line 1000 M(126) M(341) M(565) ...
3
by: Sandro Dentella | last post by:
Hi everybody, I'm trying to fix the packaging of a very simple package, but some problem show me that I have not well understood the whole mechanism The structure of my package (some debug...
4
by: Joakim Hove | last post by:
Hello, i have simple function like this: def log_msg(msg , file , line): print "%s:%s %s" % (file,line,msg) the file and line arguments should be the filename and linenumber of the...
5
by: Neo | last post by:
Hie, Can I put __FILE__ and __LINE__ macros inside the class function which may not be inline. And void function() { classobject::LogInfo(...); } Internally LogInfo should log file name...
3
by: travis.downs | last post by:
Hi, I'm trying to use a macro to create a unique temporary variable name, such as #define TEMP_OBJ(string) MyType obj_ <some magic here(string); So something like TEMP_OBJ("foo")
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.