Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Reusing data from the listener

A topic by razetime created Dec 10, 2023 Views: 118 Replies: 3
Viewing posts 1 to 3

I can see that me and selected can be used in the listener to copy data from the listener to the deck, but I am wondering how to just copy listener text to clipboard. I was thinking of creating a field and copying the data over to its text field, but I’m not sure how to get the lil representation of a value as a string without a little more complicated queries.

I also want to know if there is a way to reuse previous lines in the listener without having to scroll to them and clicking on them.

Developer(+1)

If Listener output was a string, you can click on it and copy it to the Listener input field, just like expressions you've entered previously.

Not all Lil values can be losslessly represented as strings; functions, for example, normally travel with invisible linkages to their closure, and Interface values are not necessarily serializable. Data can generally be represented by using "format" to convert it to JSON:

"%j" format x

As in Lilt, in the Listener you can reference the result of the previous evaluated expression through the variable "_" (just one underscore). This variable is automatically rebound every time you evaluate an expression. It's also very handy for getting context you can explore interactively out of a panic[].

Thanks for the info. Is there a way to get the string that show[] prints to the listener, for example? That way I can get a clickable string, and copy it over.

Developer

No. show[] does not necessarily produce textual output; Images and Tables have graphical representations, for example.