Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Variable format with string with variable
#1
I understand that with

Quote:out F"{k%%5i}"
you may output variable k in a 5-characters wide integer field.

My question is : Is it possible to output in a variable length field? ie. instead of explicitly defining the value "5" to have it stored in an integer variable.
#2
Not with F"". Use str.format or out.

Macro Macro2514
Code:
Copy      Help
int k=12
int v=5
str s.format("%*i" v k)
out s
;or
out "%*i" v k
#3
Thank you very much for an excellent advice.


Forum Jump:


Users browsing this thread: 1 Guest(s)