//String Processor //v0.1.3 int Preprocess_Buffer[2147447]; void PreProcessString(int address){ int strings[]={string1,string2,string3,string4,string5,string6,string7,string8,string9,string10}; int string1[214747]={ } int string2[214747]={ } int string3[214747]={ } int string4[214747]={ } int string5[214747]={ } int string6[214747]={ } int string7[214747]={ } int string8[214747]={ } int string9[214747]={ } int string10[214747]={ } //Get the address int adr_lookup; //A place to store the last located address in a string. int adr_buffer[6]; //A place to store the string address as char. int read_adr_buffer[6]; int q = 0; int e = 0; int r = 0; int t = 0; int u; int i; int adr_index[3]; int matched_adr; int end_of_string; //Convert the addres to char and store it in the buffer. itoa(adr_buffer,address); int checking_adr; //Load each big string table from the array with their pointers for ( ; q <= SizeOfArray(strings); q++ ) { //! <= is intentional here. //This needs to be a while loop. if ( q == SizeOfArray(strings) break; //A safety break from the loop if we scan every string for the address //and we don't find it. while ( !matched_adr && !end_of_string ) { //Scan the string, and find the $ char for ( ; w <= SizeOfArray(strings[q]); w++ ) { if ( w == SizeOfArray(strings) { end_of_string = 1; //We finished parsing this string. Time to try the next one. break; //Returns to 'q' loop, and sets the next string pointer in the list, to scan it. } if ( matched_adr ) break; //Eits the for loop, back to tht while loop, and the string is copied to the processing buffer. //If the loop is still running... if ( strings[q][w] == IsChar(CHAR_DOLLAR) ) { //We found an address, let's store it. adr_index[0] = q; adr_index[1] = w; //0 is the string pointer, 1 is the index with the $ token for ( e = adr_index[1]; e < SizeOfArray(adr_index[1]); e++ ) { //Find a colon if ( adr_index[1][e] == IsChar(CHAR_COLON) ) { //We found a colon, so store it... adr_index[2] = e; //2 is the index of the colon, so we know where to end the loop. //Copy the address into the buffer, and compare the two buffers. t = 0; //Clear this, as we'll need it. for ( r = adr_index[1]; r < adr_index[2]; r++ ) { read_adr_buffer[t] = adr_index[0][r]; t++; //Store into the buffer. checking_adr = 1; } if ( checking_adr ) break; } } //Compare the read buffer to the lookup buffer. //Store the value we read into read_adr_buffer by //converting it into a number: adr_lookup = atoi(read_adr_buffer); //See if it matches: if ( adr_lookup == address ) { matched_adr = 1; break; } else { matched_adr = 0; continue; } //for ( u = 0; q < 6; u++ ) { //if ( read_adr_buffer[u] == adr_buffer[u] ) matched_adr = 1; // else { // matched_adr = 0; //not a match // //Go back to w, and start on the position next in the list. // break; // } //} } } if ( matched_adr ) { //Store the string: //Use the values that we recorded for the pointer, the first index, and the last index, and copy the string to our main buffer for processing. return; //Exit the function. } } } } }