Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Начинающим";
Текущий архив: 2005.12.25;
Скачать: [xml.tar.bz2];

Вниз

Assignment to FOR-Loop variable n    Найти похожие ветки 

 
RX   (2005-12-08 01:14) [0]

помогите с циклом! subj выдаётся

       for n:=1 to ssize do                 {цикл}
           begin
           comp:=comp+stack[ssize-n];
           if comp=gramrules[m] then   {условие}
              begin
              Result:=Result+" "+inttostr(m);
              for o:=1 to n do stack[ssize-o]:="";
              stack[ssize-n]:="E";
              comp:="";
              cnt:=cnt+1;                
              break;
              end;
           n:=n+1;
           end;

я хочу наращивать счётчик если не вхожу по условию
а если условие выполняется то выйти из цикла


 
Reindeer Moss Eater ©   (2005-12-08 01:17) [1]

Счетчик самому изменять запрещено законом.
Выйти из цикла - Break


 
RX   (2005-12-08 01:20) [2]

break то я уже написал если ты не заметил а вот счётчик не работает
как быть то с алгоритмом?


 
Джо ©   (2005-12-08 01:21) [3]


>  [2] RX   (08.12.05 01:20)
> как быть то с алгоритмом?

Выбросить. Или, как минимум, объяснить, что он делает.


 
RX   (2005-12-08 01:22) [4]

Удалено модератором


 
Reindeer Moss Eater ©   (2005-12-08 01:22) [5]

Значение счетчика самому менять нельзя.


 
Джо ©   (2005-12-08 01:23) [6]


>  [4] RX   (08.12.05 01:22)
> он ведь сам это того?

Типа того, дружище.


 
Кефир87 ©   (2005-12-08 01:36) [7]

Ничего не ясно, но может нужно использовать Continue

Delphi 7 Help:

Continue
Allows the flow of control to proceed to the next iteration of for, while, or repeat statements.

Unit

System

Category

flow control routines

Delphi syntax:

procedure Continue;

Description

In Delphi code, the Continue procedure causes the flow of control to proceed to the next iteration of the enclosing for, while, or repeat statement.

The compiler reports an error if a call to Continue isn"t enclosed by a for, while, or repeat statement.

Note: Continue does not violate the flow of control dictated by a try..finally construct. If a call to Continue causes control to leave the try clause, the finally clause is entered.


 
Плохиш ©   (2005-12-08 02:10) [8]

Удалено модератором
Примечание: И не цитируем


 
Anatoly Podgoretsky ©   (2005-12-08 13:25) [9]

Чудаки еще впереди, когда до сдачи останется день или менее.



Страницы: 1 вся ветка

Форум: "Начинающим";
Текущий архив: 2005.12.25;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.46 MB
Время: 0.016 c
11-1112295083
Boguslaw Brandys
2005-03-31 22:51
2005.12.25
PIcon Draw problem in tray icon KOL program


5-1118839875
Чайник
2005-06-15 16:51
2005.12.25
Удаление свойства-компонента.


14-1133475106
sedot
2005-12-02 01:11
2005.12.25
Анонимная почта


1-1133199171
Gear
2005-11-28 20:32
2005.12.25
CPU и функция вызвавшая ошибку.


2-1133795224
BST
2005-12-05 18:07
2005.12.25
String -> WideString





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский