ORIGIN '~beta/basiclib/formatio';
--- program: descriptor ---
(# i1, i2, i3, i4, i5: @integer;
s1, s2: ^text;
r1, r2, r3: @real;
chr: @char;
t, fmt: ^text;
do '123,%456, 789 JorgenLKnudsen 1.2,2+2=43.45, 67.89 abc, 101, 0x101, 0101, 101xxx'->t[];
0->t.pos;
'input:\t"%s"\n\n' -> putFormat(# do t[]->s #); newline;
'%i,%%%i, %i' -> fmt[] -> t.getFormat(# do i->i1; i->i2; i->i3 #);
'format:\t%s\nread:\t%i, %i, %i\n\n'
-> putFormat(# do fmt[]->s; i1->i; i2->i; i3->i #);
'%6s%c%s' -> fmt[] -> t.getFormat(# do s->s1[]; c->chr; s->s2[] #);
'format:\t"%s"\nread:\t"%s", "%c", "%s"\n\n'
-> putFormat(# do fmt[]->s; s1[]->s; chr->c; s2[]->s #);
'%f,2+2=4%e, %f' -> fmt[] -> t.getFormat(# do f->r1; e->r2; f->r3 #);
'format:\t"%s"\nread:\t%f, %f, %f\n\n'
-> putFormat(# do fmt[]->s; r1->f; r2->f; r3->f #);
'%x, %o, %i, %i, %i%s' -> fmt[]
-> t.getFormat(# do x->i1; o->i2; i->i3; i->i4; i->i5; s->s1[] #);
'format:\t"%s"\nread:\t%i, %i, %i, %i, %i, "%s"\n'
-> putFormat(# do fmt[]->s; i1->i; i2->i; i3->i; i4->i; i5->i; s1[]->s #);
'123,%456, 124 %JorgenLKnudsen 1.2,2+2=43.45, 67.89 abc, 111, 0x111, 0111, 111xxx'->t[];
0->t.pos;
'\n\ninput:\t"%s"\n\n' -> putFormat(# do t[]->s #); newline;
'%i,%%%i, %i %6s%c%s%f' -> fmt[] -> t.getFormat(# do i->i1; i; i->i2; s; c; s; f->r1; #);
'format:\t%s\nread:\t%i, %i, %f\n\n'
-> putFormat(# do fmt[]->s; i1->i; i2->i; r1->f; #);
#) |