34 lines
1.2 KiB
Plaintext
34 lines
1.2 KiB
Plaintext
///////////////////////////////////////////////////////////////////////////////////
|
|
// REAL TIME STRATEGY ADVENTURE - Kit
|
|
// FILE:rtsa_headerp
|
|
// NAME: Header file Parser
|
|
// SCRIPTED BY: Deva Bryson Winblood
|
|
// DATE: 03/26/2003
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
/* This header contains the parser functions for processing names and storing
|
|
data. It does not need to included unless you need to parse something. */
|
|
|
|
string fnParse(string sIn,string sDelim=".")
|
|
{ // Parse string using delimiter
|
|
string sRet="";
|
|
string sWork=sIn;
|
|
while(GetStringLeft(sWork,1)!=sDelim&&GetStringLength(sWork)>0)
|
|
{ // build return string
|
|
sRet=sRet+GetStringLeft(sWork,1);
|
|
sWork=GetStringRight(sWork,GetStringLength(sWork)-1);
|
|
} // build return string
|
|
return sRet;
|
|
} // fnParse()
|
|
|
|
string fnRemoveParsed(string sIn, string sRemove, string sDelim=".")
|
|
{ // remove parsed portion of string and return the remaining
|
|
string sRet="";
|
|
if (GetStringLength(sIn)>=GetStringLength(sRemove))
|
|
{ // strip it
|
|
sRet=GetStringRight(sIn,GetStringLength(sIn)-GetStringLength(sRemove));
|
|
if (GetStringLeft(sRet,1)==sDelim)
|
|
sRet=GetStringRight(sRet,GetStringLength(sRet)-1);
|
|
} // strip it
|
|
return sRet;
|
|
} // fnRemoveParsed()
|