is there any way to prevent type changing while using astring() - astore()?
Code:declare a[2] a[1] = "a" a[2] = 2.0 ?type("a[2]") // N x = astring(a,",") =astore(aa,x,",") ?type("aa[2]") // C
is there any way to prevent type changing while using astring() - astore()?
Code:declare a[2] a[1] = "a" a[2] = 2.0 ?type("a[2]") // N x = astring(a,",") =astore(aa,x,",") ?type("aa[2]") // C
No it treats all items in the comma separated list as character strings.
You may want to look at json_encode() / json_decode() and metadata_encode() / metadata_decode() also.Code:for I=1 to alen(a) if isdigit(a[i]) a[i] = val(a[i]) endif endfor
Last edited by barrymavin; 2020-11-05 at 21:45.
Principal developer of Lianja, Recital and other products
Follow me on:
Twitter: http://twitter.com/lianjaInc
Facebook: http://www.facebook.com/LianjaInc
LinkedIn: http://www.linkedin.com/in/barrymavin
Bookmarks