/*
//Case Sensitive Search For Substring Using .InStr()
#include <stdio.h>
#include "Strings.h"

int main(void)
{
 String s1("Frederick John Harris");
 int iLoc=0;
 
 iLoc=s1.InStr("John", true);
 if(iLoc)
    printf("The Sub String 'John' Is Contained In s1 And Begins At %d\n",iLoc);
 else
    printf("The Sub String 'John' Is Not Contained In s1\n");
 getchar();   
    
 return 0;   
}
*/

/*
Entering String(const char* pStr)  //Constructor: Initializes with char*
  this = 2293584
  pStr = Frederick John Harris
  pStrBuffer = 4072496  Frederick John Harris
Leaving String(const char* pStr)

The Sub String 'John' Is Contained In s1 And Begins At 11
*/

///////////////////////////////////////////////////////////////////////////////

/*
//Non-Case Sensitive Search For Substring Using .InStr()
#include <stdio.h>
#include "Strings.h"

int main(void)
{
 String s1("Frederick John Harris");
 int iLoc=0;
 
 iLoc=s1.InStr("john", false);  //use false for 2nd parameter
 if(iLoc)
    printf("The Sub String 'John' Is Contained In s1 And Begins At %d\n",iLoc);
 else
    printf("The Sub String 'John' Is Not Contained In s1\n");
 getchar();   
    
 return 0;   
}
*/

/*
Entering String(const char* pStr)  //Constructor: Initializes with char*
  this = 2293584
  pStr = Frederick John Harris
  pStrBuffer = 4072496  Frederick John Harris
Leaving String(const char* pStr)

The Sub String 'John' Is Contained In s1 And Begins At 11
*/
///////////////////////////////////////////////////////////////////////////////

/*
  Here would be kind of a work example for me that shows a common use of mine 
  for Left, Right, and Mid.  Our foresters put their 100% tally timber marking
  data collector files (I wrote the programs with PB DOS) in C:\Tallies\RawData.
  The files have a *.mrk (mark) extension.  My desktop PowerBASIC program reads
  the binary file and creates an Access database containing the data in...
  
  C:\Tallies\DBFiles\SaleName.mdb
  
  where SaleName.mdb would be something like 15200901.mdb for the 1st sale in 
  our District 15 for 2009.  So you start with a data collector file name and
  location such as this...
  
  C:\\Tallies\\RawData\\15200901.mrk
  
  and need to parse that string and create an Access database such as this...
  
  C:\\Tallies\\DBFiles\\15200901.mdb
*/


#include <stdio.h>
#include "Strings.h"

int main(void)
{
 String s1("C:\\Tallies\\RawData\\15200901.mrk");
 String s2,s3; 
 
 s2=s1.Left(11);
 s2.Print(true);
 s3=s1.Mid(20,8);
 s3.Print(true);
 s2=s2+"DBFiles\\"+s3+".mdb";
 s2.Print(true);
 getchar();   
    
 return 0;   
}

/*
C:\Tallies\
15200901
C:\Tallies\DBFiles\15200901.mdb
*/
///////////////////////////////////////////////////////////////////////////////




