regString method

int regString(
  1. ClipParam param,
  2. String line,
  3. bool strToVal
)

Implementation

int regString( ClipParam param, String line, bool strToVal ){
	int i;
	int ret;
	int len;
	String curLine = "";

	ClipLineData tmp = _newLine();
	tmp._token = ClipToken();

	int top = 0;
	int cur = 0;

	while( top + cur < line.length ){
		if( ClipMath.charAt( line, top + cur ) == ';' ){
			if( !_checkEscape( line, top, cur ) ){
				curLine = line.substring( top, top + cur );

				if( (ret = tmp._token!.regString( param, curLine, strToVal )) != ClipGlobal.noErr ){
					return ret;
				}

				tmp        = _newLine();
				tmp._token = ClipToken();

				top = top + cur + 1;
				cur = 0;

				continue;
			}
		} else if( ClipMath.charAt( line, top + cur ) == '#' ){
			if( !_checkEscape( line, top, cur ) ){
				// コメントを登録する
				len = line.length - (top + cur + 1);
				tmp._comment = "";
				for( i = 0; i < len; i++ ){
					int tmp2 = top + cur + 1 + i;
					if( ClipGlobal.isCharEnter( line, tmp2 ) ){
						break;
					}
					tmp._comment = tmp._comment! + ClipMath.charAt( line, tmp2 );
				}

				line = line.substring( top, top + cur );
				curLine = line;
				continue;
			}
		}
		cur++;
		curLine = line.substring( top, top + cur );
	}

	_nextNum++;

	return tmp._token!.regString( param, curLine, strToVal );
}