The functions at the end of the c code are testing functions. I wouldn't just drop this in to anything unless you take at look at the TEXT* definitions, I work in 1920x1200 resolution so my x,y positions are typically way outside what you may be working on. Feel free to use, choose, chop, spindle, mutilate, bend, or otherwise abuse the code as it may serve your purpose. I usually end up writing tons of small helper codes like these then eventually try to consolidate my final project using the pieces that work best for the project at hand.

There are some potentially advanced ideas presented in the queueing mechanism that I'm still working on. Currently it makes sure the actual strings added to a text object occur to only one text object at a time. I am writing a new branch of this code that will maintain the atomic nature of the text update functions but allow each text object to receive a string at a time rather than waiting for a single text object to update before processing another string.

The idea in TTqueue is that a text object number, the text string to send to that text object and a delay variable are sent in as parameters and the TTqueue function has a buffer text object that it loads with the input string, another buffer that holds the text object number and yet another buffer that holds the delay value. These buffer arrays are then handled in a while loop sending each entry to another function; TT_addText, which then typewriter's the text to the given text object with the delay stored for that individual string. Multiple calls can occur near simultaneously because the first part of the function handles adding the input info and the while loop happily processes whatever is there even while more data is added.

To address your question specifically you'll note that I do str_cpy's to text objects as well as pointer arithmetic to place 1 char at a time into the destination text object string.

A bunch of the objects are merely for testing but I hope you find at least some of it useful.

correction to some of the code notes: Where you see this particular loop code
Code:
	for( cnt = 0 ; cnt < trunc ; cnt++ )
	{
		pdest[cnt] = 17; // this is the pseudo-cursor placed first, then replaced with the actual character
		wait(slowvar);
		pdest[cnt] = psrc[cnt];
		if( cnt == _INT(vTT_LineLength) ) break; // if cnt == input string length, break loop
	}


I'm doing pointer math, simple and effective. I think some of my function comment entries say I do str_cpy's then I actually ended up doing it with pointers this way, just a heads up in case you see it and wonder why the discrepency.

Be good or be good at it, failing that, run faster!
Quantum Mechanic
'Better living at the subatomic level'


Last edited by quantum69; 07/29/08 06:45.

------------------------------------
Quantum Mechanic
Better living at the subatomic level