Convert the field's value to a index (for popup) (usually overidden).
@param string The string to convert to an index.
@return The resulting index.
357195
public int convertStringToIndex(String tempString)
    {
        int index = 1;
        if (tempString.length() == 0)
            return (short)index;
        if ((tempString.charAt(0) >= '0') & (tempString.charAt(0) <= '9'))
            index = tempString.charAt(0) - '0';             // Convert to number; 1 = 1, 2 = 2, etc...
        if ((tempString.charAt(0) >= 'A') & (tempString.charAt(0) <= 'Z'))
            index = tempString.charAt(0) - 'A' + 1;         // Convert to number; A = 1, B = 2, etc...
        if ((tempString.charAt(0) >= 'a') & (tempString.charAt(0) <= 'z'))
            index = tempString.charAt(0) - 'a' + 1;         // Convert to number; a = 1, b = 2, etc...
        return index;   // Return the position
    }
1328758
public int convertIndexToField(int index, boolean bDisplayOption, int iMoveMode)
    {   // User selected an item... Read it in!
        int iErrorCode = this.moveToIndex(index);
        if (iErrorCode == DBConstants.NORMAL_RETURN)
            m_record.handleRecordChange(null, DBConstants.SELECT_TYPE, bDisplayOption);   // Record selected!!!
        // These next lines causes the FieldBehaviors with SCREEN_MOVE to be executed!!!
        FieldInfo field = this.getField();
        if (iErrorCode == DBConstants.NORMAL_RETURN) if (field != null)
        {
            if (field instanceof ReferenceField)
                ((ReferenceField)field).setReference(m_record, bDisplayOption, iMoveMode);
            else if (field instanceof StringField)
            {
                {
                    if (displayFieldName != null)
                        return field.setString(m_record.getField(displayFieldName).toString());
                    else
                        return field.setString(m_record.getField(m_iFieldSeq).toString());
                }
            }
        }
        return iErrorCode;
    }
899292
public function setGetfield($string)
    {
        if (!is_null($this->getPostfields())) 
        { 
            throw new Exception('You can only choose get OR post fields.'); 
        }
        
        $search = array('#', ',', '+', ':');
        $replace = array('%23', '%2C', '%2B', '%3A');
        $string = str_replace($search, $replace, $string);  
        
        $this->getfield = $string;
        
        return $this;
    }
1304341
public void text(String str)
    {
        if (fieldNames.isEmpty() || fieldValues.isEmpty())
            return;
        
        String val = (String)fieldValues.pop();
        val += str;
        fieldValues.push(val);
    }
677117
public function insert($string, $position)
    {

        if (!is_int($position) || is_array($string)) {
            throw new PrimitiveException('invalid index or string');
        }


        $this->setInternalValue(substr($this->getInternalValue(), 0,
                $position) . (string)$string . substr($this->getInternalValue(), $position));

        return $this;
    }
1374842
public int getFieldExprIndex(final String _expr)
    {
        int ret = -1;
        if (getAllFieldExpr().containsKey(_expr)) {
            final Integer ident = getAllFieldExpr().get(_expr);
            ret = ident.intValue();
        }
        return ret;
    }
979138
@Override
    public T get(int index) {
        /* Check that this is a valid index. */
        if (index < 0 || index >= size())
            throw new IndexOutOfBoundsException("Index " + index + ", size " + size());

        /* Look up the element. */
        return mArrays[computeOffset(index)][computeIndex(index)];
    }
908705
public int valueToIndex(Object value)
    {
        if (value != null)
            if (!(value instanceof String))
                value = value.toString();
        if ((m_record != null) && (m_strIndexValue != null))
        {
            try   {
                FieldTable table = m_record.getTable();
                for (int iIndex = 0; ; iIndex++)
                {
                    if (table.get(iIndex) == null)  // I use get, so the index matches the index of JComboBox
                        break;
                    FieldInfo field = m_record.getField(m_strIndexValue);
                    if (field == null)
                        field = m_record.getField(0);
                    String strValue = field.getString();
                    if ((strValue != null) && (strValue.length() > 0))
                        if (strValue.equals(value))
                            return iIndex + 1;
                }
            } catch (Exception ex)  {
                ex.printStackTrace();
            }
        }
        else
        {
            this.setSelectedItem(value);
            if (this.getSelectedIndex() != -1)
                return this.getSelectedIndex();
        }
        return 0;
    }
1241900
protected function convertToLookup($string) {
        $array = explode('|', str_replace(' ', '', $string));
        $ret = array();
        foreach ($array as $i => $k) {
            $ret[$k] = true;
        }
        return $ret;
    }
109664
public function setValue($string)
    {
        if (! is_array($string)) {
            $string = explode(",", $string);
        }

        $extras = ['noodp', 'noarchive', 'nosnippet',
            'noimageindex', 'noydir', 'nocache'];

        $indexes = ['index', 'noindex'];

        $follows = ['follow', 'nofollow'];

        foreach ($string as $key => $value) {
            $key = trim(strtolower($key));
            $value = trim(strtolower($value));

            if ($key == 'index' || in_array($value, $indexes)) {
                $this->index = $value;
            } elseif ($key == 'follow' || in_array($value, $follows)) {
                $this->follow = $value;
            } elseif (in_array($value, $extras)) {
                $this->extra[] = $value;
            }
        }
        return $this;
    }
1262023
public int getFieldIndex(String name) {
		Integer val = this.nameToIndex.get(name);
		if (val == null) {
			return -1;
		}
		return val;
	}
106351
function getRowIndexByValue(field, value) {
    var index = -1;
    $.each(this.dataSourceObj.rows, function (i) {
        // var v = $(this.value).attr(field);
        var v = this.value[field];
        if (v == value) {
            index = i;
        }
    });
    return index;
}
963900
public function tokenize($string)
    {
        $line     = 1;
        $position = 1;
        $tokens   = array();

        while (strlen($string)) {
            foreach ($this->expressions as $rule) {
                if (!preg_match($rule['match'], $string, $match)) {
                    continue;
                }

                // Remove matched string from input
                $string = substr($string, strlen($match[0]));

                // Update position in file
                $line += substr_count($match[0], "\n");
                if (($pos = strrpos($match[0], "\n")) !== false) {
                    $position  = strrpos($match[0], "\n") + 1;
                } else {
                    $position += strlen($match[0]);
                }

                // Skip irrelevant rules
                if (in_array($rule['type'], $this->ignoreTokens)) {
                    continue 2;
                }

                // Add all other rules including their match to the token array
                $match = $this->removeNumericKeys($match);
                $tokens[] = new Token($rule['type'], $line, $position, $match);
                continue 2;
            }

            throw new \RuntimeException(
                "Could not parse string: '" . substr($string, 0, 20) . "' in line $line at position $position."
            );
        }

        $tokens[] = new Token(self::T_EOF, $line, $position, null);
        return $tokens;
    }
696982
public function get($index = 0, $field = null) {
        if ($this->performed) {
            if (is_numeric($index)) {
                $index = intval($index);
            } else if (is_string($index)) {
                $field = $index;
                $index = 0;
            } else {
                return null;
            }
        } else {
            if (is_array($index)) {
                return $this->where($index);
            }

            if (is_numeric($index)) {
                $index = intval($index);
            } else if (is_string($index)) {
                $field = $index;
                $this->field($field);
                $index = 0;
                $this->limit(0, 1);
            } else {
                $index = 0;
            }
            $this->select();
        }
        if (isset ($this->resultSets [ $index ])) {
            $row = $this->resultSets [ $index ];
            if ($field != null && isset ($row [ $field ])) {
                return $row [ $field ];
            }
            if ($field == null) {
                return $row;
            }
        }

        return null;
    }
528035
@Override
    public String getString(int index) throws IndexOutOfBoundsException {
        indexCheck();
        return rows.get(row).getString(index);
    }
605001
@Override
    public String getValue() {
        switch (getSelectedIndex()) {
        case 0:
            if (internVal == null) return null;
            internVal = getValue1();
            return internVal;
        case 1:
            internVal = getValue2();
            return internVal;
        default:
            return null;
        }
    }
618266
public String getString(int index)
  {
    Object value = _values[index - 1];

    if (value != null) {
      return value.toString();
    }
    else {
      return null;
    }
  }