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

Вниз

Вырубаем строку(по-хорошему)...   Найти похожие ветки 

 
Хомячок   (2003-12-30 11:04) [0]

Народ,а как сделать так,чтобы при опроеделённых условиях строка ремировалась?То есть допустим:
if d=1 then {Showmessage("Heeelp! ! !");}
Конечно то,что в фигурных скобках как бы програмно ремируется.
Как это сделать???
Помогите плииз!
прошу не предлагать варианты:с условием if///


 
REA   (2003-12-30 11:06) [1]

Программно вряд ли, а так есть директива Assert и IFDEF разные.
А почему не поставить эти условия?
If условия Then


 
Хомячок   (2003-12-30 11:21) [2]


> Программно вряд ли, а так есть директива Assert и IFDEF
> разные.
> А почему не поставить эти условия?
> If условия Then

А это как так поставить?


 
Ega23   (2003-12-30 11:25) [3]

if d<>1 then Showmessage("Heeelp! ! !");
Вроде всё.


 
Тимохов   (2003-12-30 11:37) [4]

А что такое "ремировалась"?


 
Ega23   (2003-12-30 11:38) [5]


> "ремировалась"?

Это, типа, "комментировалась". Только зачем?


 
Тимохов   (2003-12-30 11:43) [6]

Полностью согласен с REA © (30.12.03 11:06) [1].
Лучше, наверное, IFDEF.
Главное не забывать после изменений conditionals в Project options делать полный билд проекта.


 
Хомячок   (2003-12-30 18:35) [7]

Как пользоваться этими IFDEF?


 
Тимохов   (2003-12-30 18:40) [8]

Уважаемый, Хомячокс.
В Новом году (кстати, с новым годом Вас) предлагаю к советам на данном форму относиться так:
1. Если в форуме по дельфи дан совет, значит он относится к дельфи.
2. Если что-то относится к дельфи, то обязательно при наличии этой самой дельфи (вряд ли вы интересуетесь дельфи из спортивного интереса - дельфи у вас обязательно есть), можно получить справку.
3. Набираем в тексте программы указанную фразу и нажимаем f1. В итоге получаем справку.

Не забываем читать "see also".

Все.
Удачи в новом году!


 
Rouse_   (2003-12-30 18:50) [9]

{$DEFINE LAMER}

...

{$IFDEF LAMER}
ShowMessage("LMD!!!");
{$ELSE}
ShowMessage("RTFM!!!");
{$ENDIF}


Желаю успехов в новом году ;)


 
Тимохов   (2003-12-30 18:52) [10]

Что такое RTFM я знаю.
Что такое LMD?


 
Rouse_   (2003-12-30 18:54) [11]

> [10] Тимохов © (30.12.03 18:52)
Ламерс маст дай ;)


 
Тимохов   (2003-12-30 18:55) [12]

:)))


 
Хомячок   (2003-12-30 21:37) [13]


> {$DEFINE LAMER}
>
> ...
>
> {$IFDEF LAMER}
> ShowMessage("LMD!!!");
> {$ELSE}
> ShowMessage("RTFM!!!");
> {$ENDIF}

поясните чё к чему


 
jack128   (2003-12-30 21:40) [14]


> Ламерс маст дай ;)
Прикрати издеваться над человеком ;-)
ИМХО, _Rouse предложил удалить строку

> {$DEFINE LAMER}
и посмотреть на результат..


 
Rouse_   (2003-12-31 08:53) [15]

> [14] jack128 © (30.12.03 21:40)
:)))

Только я не издевался а привел ответ соответствующий вопросу... ;)
И F1 никто пока не отменял, тем более что полный хэлп по директивам компилятора в нем приведен...


 
Хомячок   (2003-12-31 12:02) [16]

Чё это всё ответы помогите...


 
Anatoly Podgoretsky   (2003-12-31 12:05) [17]

А что еще нужно? Ты понкретнее свои желания формулируй.


 
Строитель   (2003-12-31 12:23) [18]

2 Anatoly Podgoretsky
>> Ты понкретнее свои желания формулируй.
Дед Мороз... ;))))))))))))))


 
Serge   (2003-12-31 12:31) [19]

> Хомячок © (31.12.03 12:02) [16]

Если бы ты был повнимательнее то
Rouse_ © (30.12.03 18:50) [9] очень бы тебе помог

Покопайся по исходникам дельфей - там найдешь что-то типа:

function AnsiStrLComp(S1, S2: PChar; MaxLen: Cardinal): Integer;
{$IFDEF MSWINDOWS}
begin
Result := CompareString(LOCALE_USER_DEFAULT, 0,
S1, MaxLen, S2, MaxLen) - 2;
end;
{$ENDIF}
{$IFDEF LINUX}
begin
Result := InternalAnsiStrLComp(S1, S2, MaxLen, True);
end;
{$ENDIF}


Надеюсь вопросов больше не возникнет.
С наступающим!


 
Хомячок   (2004-01-01 19:02) [20]

Чё-то ни{цензура} не понял...


 
Хомячок   (2004-01-03 10:45) [21]

ну распишите всё получше


 
Serge   (2004-01-03 11:28) [22]

Ну млин, тебе что - в хэлп трудно залезть - или у тебя дистрибутив дельфей хелпа не предусматривает ?

Conditional compilation is based on the existence and evaluation of constants, the status of compiler switches, and the definition of conditional symbols.

Conditional symbols work like Boolean variables: They are either defined (true) or undefined (false). Any valid conditional symbol is treated as false until it has been defined. The $DEFINE directive sets a specified symbol to true, and the $UNDEF directive sets it to false. You can also define a conditional symbol by using the -D switch with the command-line compiler or by adding the symbol to the Conditional Defines box on the Directories/Conditionals page of the Project|Options dialog.

The conditional directives $IFDEF, $IFNDEF, $IF, $ELSEIF, $ELSE, $ENDIF, and $IFEND allow you to compile or suppress code based on the status of a conditional symbol. $IF and $ELSEIF allow you to base conditional compilation on declared Pascal identifiers. $IFOPT compiles or suppresses code depending on whether a specified compiler switch is enabled.

For example,

{$DEFINE DEBUG}

{$IFDEF DEBUG}
Writeln("Debug is on."); // this code executes
{$ELSE}
Writeln("Debug is off."); // this code does not execute
{$ENDIF}

{$UNDEF DEBUG}

{$IFNDEF DEBUG}
Writeln("Debug is off."); // this code executes

{$ENDIF}

Conditional-directive constructions can be nested up to 32 levels deep. For every {$IFxxx}, the corresponding {$ENDIF} or {$IFEND} must be found within the same source file.

Conditional symbols must start with a letter, followed by any combination of letters, digits, and underscores; they can be of any length, but only the first 255 characters are significant. Delphi defines the following standard conditional symbols.

VER140 Always defined, indicating that this is version 14.0 of the Object Pascal compiler. (Each compiler version has a corresponding predefined symbol. For example, version 10.0 has VER100 defined.)
MSWINDOWS Indicates that the operating environment is Windows. Use MSWINDOWS to test for any flavor of the Windows platform instead of WIN32. .
WIN32 Indicates that the operating environment is the Win32 API. Use WIN32 for distinguishing between specific Windows platforms, such as 32-bit versus 64-bit Windows. In general, don"t limit code to WIN32 unless you know for sure that the code will not work in WIN64. Use MSWINDOWS instead.

LINUX Indicates that the operating environment is Linux.
CPU386 Indicates that the CPU is an Intel 386 or better.
CONSOLE Defined if an application is being compiled as a console application.
CONDITIONALEXPRESSIONS Tests for the use of $IF directives.

Note: An important conditional symbol that is NOT defined is LINUX. This is defined only on the Linux version of the compiler, and can be used to protect platform-specific code in cross-platform applications.

Conditional symbols are not Pascal identifiers and cannot be referenced in actual program code. Similarly, Pascal identifiers cannot be referenced in any conditional directives other than $IF and $ELSEIF.

Note: Conditional definitions are evaluated only when source code is recompiled. If you change a conditional symbol"s status and then rebuild a project, source code in unchanged units may not be recompiled. Use Project|Build All Projects to ensure everything in your project reflects the current status of conditional symbols.



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

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

Наверх





Память: 0.51 MB
Время: 0.01 c
1-49497
serg128
2004-01-03 12:51
2004.01.16
Как закрывать MDI окна по клавише Esc?


3-49425
chtr
2003-12-19 08:07
2004.01.16
Использование AS в инструкции JOIN


3-49431
Chery
2003-12-18 14:06
2004.01.16
Как отсортировать записи в таблице?


6-49660
kevinkf
2003-11-15 15:25
2004.01.16
Быстрое определение адреса


1-49541
Ruba
2004-01-02 15:33
2004.01.16
Как перевести string в математическое выражение?





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
Английский Французский Немецкий Итальянский Португальский Русский Испанский