RiverTim
RiverTim

Reputation: 11

In Lua: How to write a HEX value to an app that expects a HEX value?

I have an app UI that expects a HEX value e.g. foo = 0x113

I'm doing this in Lua to try to write to foo:

menu.set("Presets", "foo", "0x318")
menu.set("Presets", "888x", "-258")
menu.set("Presets", "89ab", "-60"

The values for 888x and 89ab in the app are set. The HEX value field remains empty. Could someone help please? Thanks.

Upvotes: 1

Views: 292

Answers (1)

lhf
lhf

Reputation: 72352

There is no such thing as an hex value. There are numbers expressed in hex.

So your API expects a number. No wonder "0x318" does not work. The other two work because the strings are convertible to numbers.

Bottom line: use menu.set("Presets", "foo", 0x318).

Upvotes: 1

Related Questions