Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
val() command
#1
I understand that the N7 val() command returns the value of a table element, but I am trying to convert a game that uses val(), in the traditional sense by returning the value of a string. eg: val("2") equals 2

Any ideas?

Thank you.

J
Logic is the beginning of wisdom.
Reply
#2
(04-12-2026, 06:01 AM)johnno56 Wrote: I understand that the N7 val() command returns the value of a table element, but I am trying to convert a game that uses val(), in the traditional sense by returning the value of a string. eg: val("2") equals 2

Any ideas?

Thank you.

J

"val(x)" in n7 returns true if a table contains the specified value Smile Use "int(x)" or "float(x)" to convert something to a number! There are no integers in n7, but int("2.31") converts "2.31" to a number and then removes the fractional part.
Reply
#3
Int() or float()? Cool... Much appreciated Big Grin
Logic is the beginning of wisdom.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)