Показать сообщение отдельно
Старый 06.09.2004, 12:57   #12  
Maxim Gorbunov is offline
Maxim Gorbunov
Administrator
Соотечественники
Лучший по профессии 2009
 
2,483 / 646 (26) +++++++
Регистрация: 27.11.2001
Адрес: Dubai, UAE
А зачем Вам вообще какой-то алгоритм? Есть прекрасный класс TextBuffer, который умеет работать с token'ами:
PHP код:
textBuffer = new TextBuffer();
textBuffer.setText(",,Казань,,Татарстан,11,,38");
// AXAPTA не совсем правильно работает с пустыми
// токенами, поэтому от них надо сначала избавиться
textBuffer.regularExpressions(true);
textBuffer.replace(",,"",~,");
textBuffer.replace("<,""~,");
textBuffer.replace(",>"",~");
num 0;
while (
textBuffer.nextToken(false",")) {
    
num++;
    switch (
num) {
        case 
3:
            
info(strfmt("Город: %1"textBuffer.token()));
            break;
        case 
5:
            
info(strfmt("Улица: %1"textBuffer.token()));
            break;
    }

__________________
Not registered yet? Register here!
Have comments, questions, suggestions or anything else regarding our web site? Don't hesitate, send them to me