Is there a way, i can automatcially print the line number?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
how to print line numbers
Collapse
X
-
Hello junkone,
Currently NinjaScript there is not a way to print a line number from within the code. Here are a couple of alternative options on what you could try.
One option you have would be to append an id number to your print statement.
You could then use control+F and search for the id you see in the output.Code:Print("id1" + variableName);
Or because you know you want the line number, you could look at the line number you put the print statement on and just reference it in the print statement
Please let me know if I may be of further assistance.Code:43 44 Print("Line 44 error"); 45 46
-
Hello junkone,
I did have a look into the StackFrame class yesterday before I had replied. I did try that but unfortunately it only returns a 0. Also I did try it with the debug mode enabled in NinjaScript.
Looking further into that it, generally speaking the StackFrame calls are used in debugging projects where you have a debug version of the application.
Please let me know if I may be of further assistance.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
571 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
331 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
549 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
550 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment