Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
BlackChaos
16
Years of Service
User Offline
Joined: 2nd May 2010
Location: London
Posted: 27th Nov 2012 03:40 Edited at: 27th Nov 2012 03:43
This function processes long strings of text and displays as seperate lines.

!This can be tested in a new project(no loading of anything needed.)Just copy and paste!

No screenies becuase I'm not sure how useful this would be to someone, but if it helps I'm using it to show dialogue in my RPG.

Here it is.



Not sure what the efficiency of this is but it works

Sorry about the grammer and spelling mistakesTierd
Thank,

Quote: "
fOoD OR fEEdBaCk
"


AEngine 2012 Ameadus Project Feedback or Food o0
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 28th Nov 2012 09:44
Quote: "Text processing"

When I saw that title, the first thing that popped in my head was Cobol.... Are you trying to give me nightmares!


You might want to try to output the strings as you parse them, rather than constantly creating/destroying an array. Plus, what happens if the number of lines you need is greater than the size of the array you've already allocated?

This snippet will do the same thing as your code, without using arrays.


"You're not going crazy. You're going sane in a crazy world!" ~Tick
BlackChaos
16
Years of Service
User Offline
Joined: 2nd May 2010
Location: London
Posted: 28th Nov 2012 23:00
Quote: "
Quote: "Text processing"
When I saw that title, the first thing that popped in my head was Cobol.... Are you trying to give me nightmares!
"

As in Cobol the programming language? OldSchool

Admit-tingly it wasn't well thought through, but thanks your way is much more simple Thanks.

AEngine 2012 Ameadus Project Feedback or Food o0
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 29th Nov 2012 04:52
Yea as in the language. I don't ever want to have to program with it again!

"You're not going crazy. You're going sane in a crazy world!" ~Tick
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 29th Nov 2012 14:15 Edited at: 29th Nov 2012 17:54
Phaelax, there's a tiny error with your code there. Unless it's purpose it just to wrap text cause it cut's off words.

No one seems to use tokens any more and there damn fast aswell and perfect for things like these:


Update: on further investigating, it seems tokens aren't as fast any more. I could of sworn they were faster.

Update2: You can speed up your code even more (by a lot) by using fast len(), fast left(), fast right().
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 30th Nov 2012 03:58
Quote: "When I saw that title, the first thing that popped in my head was Cobol."


Wow, that must be really old; I mistook your comment for a joke about Cobol engineering lololol.

Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 30th Nov 2012 04:16 Edited at: 30th Nov 2012 04:17
Quote: "Phaelax, there's a tiny error with your code there. Unless it's purpose it just to wrap text cause it cut's off words."

His code technically does the same thing. He just set the length appropriately so you couldn't tell without changing the charLimit to something else.

The token commands aren't documented, so even I forget they exist. (I believe I was one of the early people who discovered them too)

Yup, sure did 8 years ago.
http://forum.thegamecreators.com/?m=forum_view&t=42653&b=1

"You're not going crazy. You're going sane in a crazy world!" ~Tick
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 30th Nov 2012 21:30
Quote: "Yup, sure did 8 years ago."

Damn! That's before I was even a member!

My 2 cents. I found out that you could do this which I coined 'Command Like Functions':


http://forum.thegamecreators.com/?m=forum_view&t=108125&b=1

Login to post a reply

Server time is: 2026-07-08 01:53:21
Your offset time is: 2026-07-08 01:53:21