# Convert file and line number into Pos in macro

**URL:** https://community.haxe.org/t/convert-file-and-line-number-into-pos-in-macro/2187
**Category:** Haxe
**Tags:** macro
**Created:** [December 19, 2019, 12:53pm UTC](https://community.haxe.org/t/convert-file-and-line-number-into-pos-in-macro/2187 "2019-12-19T12:53:50Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![remcohuijser](https://community.haxe.org/user_avatar/community.haxe.org/remcohuijser/32/356_2.png) [@remcohuijser](https://community.haxe.org/u/remcohuijser)
#### Post date: [December 19, 2019, 12:53pm UTC](https://community.haxe.org/t/convert-file-and-line-number-into-pos-in-macro/2187/1 "2019-12-19T12:53:51Z")

</div>

As part of my build/test process, I run a script in an external browser. When traces are made in this script I would like to output them in the development environment by using Context.info(). This requires a position, which I somehow need to construct from a file and a line number.

I believe the haxe.display.Location file seems like something that closely matches what I have, but how can I convert this into a Pos?

---

<div class="post-metadata">

### Author: ![Confidant](https://community.haxe.org/user_avatar/community.haxe.org/confidant/32/63_2.png) [@Confidant](https://community.haxe.org/u/Confidant)
#### Post date: [December 19, 2019, 8:32pm UTC](https://community.haxe.org/t/convert-file-and-line-number-into-pos-in-macro/2187/2 "2019-12-19T20:32:19Z")

</div>

This sounds very much like [source mapping](https://haxe.org/manual/debugging-source-map.html)—have you tried that? Sorry if that’s not what you’re after.
