# Retrieving the lines from a command?

**URL:** <https://resource.dopus.com/t/retrieving-the-lines-from-a-command/51334>\
**Category:** Help & Support\
**Tags:** script, feature-request\
**Created:** [June 17, 2024, 4:41pm UTC](https://resource.dopus.com/t/retrieving-the-lines-from-a-command/51334 "2024-06-17T16:41:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MartO](https://resource.dopus.com/user_avatar/resource.dopus.com/marto/32/54727_2.png) [@MartO](https://resource.dopus.com/u/MartO)\
**Post date:** [June 17, 2024, 4:41pm UTC](https://resource.dopus.com/t/retrieving-the-lines-from-a-command/51334/1 "2024-06-17T16:41:29Z")

</div>

Would it be possible for the `Command` object to give us a `lines` property or `GetLines()` function? The `linecount` is already available and for debugging it would be very helpful to print all the lines to the log. Currently I tend to keep the lines I've added in a "shadow" array so that I can do a "dry run" and check the log before actually running the command. That works, obviously, but isn't very elegant...

(Or is this already possible but I didn't find it?)

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [June 17, 2024, 6:31pm UTC](https://resource.dopus.com/t/retrieving-the-lines-from-a-command/51334/2 "2024-06-17T18:31:21Z")

</div>

Already possible via enumerators:

```javascript
function OnClick(clickData)
{
	DOpus.ClearOutput();
	var cmd = clickData.func.command;
	cmd.AddLine("Help ABOUT");
	cmd.AddLine("Help LICENCEMANAGER");
	for (var e = new Enumerator(cmd); !e.atEnd(); e.moveNext())
	{
		DOpus.Output(e.item());
	}
}

```

Outputs:

```plaintext
Help ABOUT
Help LICENCEMANAGER

```
