# GMLscripts.com

Discuss and collaborate on GML scripts

You are not logged in.

## #1 2011-02-08 16:30:49

Big J
Member
Registered: 2009-07-26
Posts: 5

### string_wordwrap()

I was looking at this script here: http://www.gmlscripts.com/script/string_wordwrap and something caught my attention:

if (is_real(brk)) brk = "#";

Yes, a "#" is a newline in Game Maker, but wouldn't it be better to use a REAL new line by default?

if (is_real(brk)) brk = chr(13)+chr(10);

or

if (is_real(brk)) brk = "
";

Correct me if I am wrong. I do realize that I could simply pass the desired brk argument.

By the way, it's nice to see GMLscripts.com back up and running. I don't know how long the site was down waiting for a domain name renewal, but long enough for me to notice.

Last edited by Big J (2011-02-08 16:32:56)

Offline

## #2 2011-02-08 22:25:24

xot
Registered: 2007-08-18
Posts: 1,201

### Re: string_wordwrap()

I can't say you are wrong, but it's my opinion that since this is GML it should produce output that is useful for the GML functions it is likely to be used with (namely draw_text and show_message). Your suggestion might make sense for Windows users writing files or using certain DLLs, but what about the Mac users who use a different newline standard? Or potential Linux users who use yet a third standard? Sticking to the Game Maker standard makes the most sense to me. If you need something different, there is a mechanism to specify it.

Abusing forum power since 1986.

Offline

## #3 2011-02-08 22:37:48

Big J
Member
Registered: 2009-07-26
Posts: 5

### Re: string_wordwrap()

Ah, I didn't know Game Maker was cross-platform.

Offline