Razor
Razor

Reputation: 66

Pascal reading a line of text into separate strings

Basically a line looks like this: 'number number text text text' with spaces dividing them. The numbers are ok, because the readln() just splits them after the space, but it reads the 3 texts as one. How can i read them into separate strings?

Upvotes: 1

Views: 1581

Answers (1)

Razor
Razor

Reputation: 66

If anybody faces this problem, here's a really easy solution I just found: read the whole thing into a string. Then pos(' ',stringsname), then copy('spacepos'+1, 200), then delete(spacepos,200) from the first string and voilá.

Upvotes: 1

Related Questions