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.

AppGameKit Classic Chat / String Split Command - Copy and paste right into your code (no global variables!)

Author
Message
anwserman
13
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 19th Dec 2011 04:56
Hey everyone!

This is my first real big solution for the AppGameKit community, a great way to split a string up by a delimiter. It doesn't require global variables or arrays - just pass your data through a function, which split segment you want returned, and it will do it.

(Making this code also made me find a bug with AppGameKit, which I'll post at Google code

To test this code out, create a new AppGameKit project (I chose vertical) and replace the code in the main.agc file with this:



Hi there. My name is Dug. I have just met you, and I love you.
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 21st Dec 2011 17:04
Thanks for the contributions! Why not try adding it to the code snippets section of the site, it has an AppGameKit section now

I drink tea, and in my spare time I write software.
Stormwire
14
Years of Service
User Offline
Joined: 3rd Sep 2010
Location:
Posted: 6th Feb 2012 02:46
This works great thanks!
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 6th Feb 2012 13:51 Edited at: 6th Feb 2012 14:10
I translated it to C++. Here:



Somebody might find this useful.

PS.
If C++ code won't work, try including <string> and replacing all char* with string.

Login to post a reply

Server time is: 2024-11-26 15:06:02
Your offset time is: 2024-11-26 15:06:02