Get line number of script line currently executed

Q&A's, tips, howto's
Post Reply
vetelko
Posts: 21
Joined: Thu Oct 13, 2016 4:47 pm

Get line number of script line currently executed

Post by vetelko »

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

ralph.ronnquist
Posts: 216
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia

Re: Get line number of script line currently executed

Post by ralph.ronnquist »

If nothing else, you could perhaps use an expression reading counter

Code: Select all

(reader-event (fn (x) (inc $exprno) x))

Post Reply