Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Split text and save variables
#2
Macro Macro6
Code:
Copy      Help
out

str s =
;221 41
;51 122
;11 10

ARRAY(str) arr arr2 t
int i nt
nt=tok(s t -1 " []")
arr.create(nt/2)
arr2.create(nt/2)
for i 0 nt
,if(i&1) t[i].swap(arr2[i/2]); else t[i].swap(arr[i/2])

out "arr:"
out arr
out "arr2:"
out arr2

or

Macro Macro7
Code:
Copy      Help
out

str s =
;221, 41
;51, 122
;11, 10

ICsv x._create
x.FromString(s)

int i
out "arr:"
for(i 0 x.RowCount) out x.Cell(i 0)
out "arr2:"
for(i 0 x.RowCount) out x.Cell(i 1)


Messages In This Thread
Split text and save variables - by BK - 07-20-2018, 10:37 AM
RE: Split text and save variables - by Gintaras - 07-20-2018, 04:13 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)