Get line number of script line currently executed

Q&A's, tips, howto's

Get line number of script line currently executed

Postby vetelko » Sun Sep 10, 2017 7:29 pm

Hi guys,

is it possible to get line number which is currently executed in script? Somethin like:

Code: Select all
(if error  (println $lineno))
;; something magical like $it :)

Thanks in advance.
newLISP v.10.7.4 64-bit on OpenBSD IPv4/6 UTF-8 libffi
vetelko
 
Posts: 20
Joined: Thu Oct 13, 2016 4:47 pm

Re: Get line number of script line currently executed

Postby ralph.ronnquist » Mon Sep 11, 2017 2:01 am

If nothing else, you could perhaps use an expression reading counter
Code: Select all
(reader-event (fn (x) (inc $exprno) x))
ralph.ronnquist
 
Posts: 178
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia


Return to newLISP in the real world

Who is online

Users browsing this forum: No registered users and 2 guests