Re: Print a sequence (Phix)

new topic     » goto parent     » topic index » view thread      » older message » newer message
lib9 said...

Hi,

This would be more suitable for a IRC chat, but I couldn't find any Euphoria channel.

I'm not sure that there is one since freenode imploded.

lib9 said...

But I was expecting that the line buffer1:... would print all the sequence s, but only prints the first element.
To print a sequence, one has to make use of a for or while loop?
Am I interpreting the above instructions in a wrong way?

The message is there because strings are sequences. So the common mistake is to do something C-like,

printf(1, "%s\n", "hello world!") 

and wonder why only the h was printed. It's explaining that it's one format per element, a one to one pairing that increments on both sides in parallel.

Basically you only have one %s in the printf, so it will only print out the first element of the sequence. You need one %s per element to print out multiple string values in a single printf.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu