// -----------------------------------------------------------
// rd2.java                  | class rd2
// -----------------------------------------------------------
// ------------------- tScroll V 3.00 ------------------------
// Scrolling Texte Message - FreeWare -
// Author : R. BERTHOU
// E-Mail : rbl@berthou.com
// URL    : http://www.berthou.com
// -----------------------------------------------------------
// If you add new function in this applet send me a new file
// -
// Si vous ajoutez de nouvelles fonction a l'applet envoyez moi
// le source.
// -----------------------------------------------------------
// Ver  * Author     *  DATE    * Description
// ...........................................................
// 2.50 * R. BERTHOU * 13/11/99 * Can get data in string 
// 2.00 * R. BERTHOU * 26/05/97 * Input Data in file 
// .............................* Add rd2.java 
// 2.01.*.R. BERTHOU * 27/06/97.* Add Scroll Type (0, 1, 2)
// 2.02 * R. BERTHOU * 02/08/97 * Add target option in data file
// -----------------------------------------------------------

// import java.io.StreamTokenizer ;
import java.awt.Font ;


public class rd2 extends Object {
	public int	iB = -1 ;		// Backgroud Colour
	public int	iT = -1 ;		// Font Colour
	public String	sM = "" ;	// Text Message
	public String	sU = "" ;	// Jump URL
	public String	sTarg = "_self" ;	// Target URL
	public Font		wFont = null ; 
	public int		iScr  = 0 ;

	public boolean get( rd2 sS, String st, char cSep ) {
		int i = 0 ;
		int j = 0 ;
		String sF = "Arial" ;
		int    iI = 16 ;
		int    iT =	Font.PLAIN ;


		int k = 0 ;
		int k1 = 0 ;
		boolean num ;
		String p ;

		if (st == null) return false ;

		while (true) {
			i = st.indexOf(cSep, j) ;
			if (i > 0)
				p = new String(st.substring(j, i).trim()) ;
			else
				p = new String(st.substring(j).trim()) ;

			try {
				 j = Integer.parseInt(p);
				 num = (j < 18000101) ;
			}
			catch (NumberFormatException e) {
				 num = false ;
			}

			if ((i>-1) || (p.length() > 0)) {
				if (num) {
					if (k1 == 0) sS.iB   = j ;  else
					if (k1 == 1) sS.iT   = j ;  else
					if (k1 == 2) iI	     = j ;  else
					if (k1 == 3) iT      = j ;	else
					if (k1 == 4) sS.iScr = j ;
					k1++ ;
				}
				else {
					if (k == 0) sS.sM = new String(p) ; else
					if (k == 1) sS.sU = new String(p) ; else
					if (k == 2) sF	  = new String(p) ; else 
					if (k == 3) sTarg = new String(p) ; 
					k++	 ;
				}
			}

			if (i == -1) {
				if (k1 > 2) sS.wFont = new Font(sF, iT, iI);
				return ( ((k+k1)> 2) ) ;
			}
			else 
				j = i + 1 ;
		}

	}

/*
	public boolean get(rd2 sS, StreamTokenizer st) {
		int i = 0 ;
		int j = 0 ;
		String sF = "Arial" ;
		int    iI = 16 ;
		int    iT =	Font.PLAIN ;
		try {
			while (true) {
				st.nextToken() ;
				if (st.ttype == st.TT_EOL)	{
					if (i > 2)
						sS.wFont = new Font(sF, iT, iI);
					return true ;
				}
				if (st.ttype == st.TT_EOF)	return false ;

				if (st.ttype == st.TT_NUMBER) {
					if (j == 0)	sS.iB = (int)st.nval ;	 else
					if (j == 1) sS.iT = (int)st.nval ;   else
					if (j == 2) iI	  = (int)st.nval ;	 else
					if (j == 3) iT    = (int)st.nval ;	 else
					if (j == 4) sS.iScr = (int)st.nval ;
					j++ ;
				}
				else {
					if (i == 0) sS.sM = new String(st.sval) ; else
					if (i == 1) sS.sU = new String(st.sval) ; else
					if (i == 2) sF	  = new String(st.sval) ; else 
					if (i == 3) sTarg = new String(st.sval) ; 
					i++	 ;
				}
			}
		} catch(Exception e) {
			return false;
		}
	}
*/

}


