الدراسة الجزائري
---------------------------------

موقع الدراسة الجزائري هو أول موقع تعليمي للدراسة في الجزائر يوفر جميع الدروس لجميع المواد و في جميع الأطوار وفق المنهاج المدرسي و بالتفصيل مع دروس مفصلة بالفيديو وحلول لتمارين الكتب المدرسية و الكثير من التمارين و الفروض و الإختبارات و حلولها و البكالوريات السابقة ..

آخر الأحداث

The If-Then-Else Statement in Delphi Code


 In Delphi, the on the off chance that assertion is utilized to test for a condition and, execute segments of code in view of whether that condition is True or False.

A general in the event that else proclamation seems to be this:

 

Both the "true block" and the "false block" can either be a straightforward proclamation or an organized assertion (surrounded with a begin-end pair).

Illustration of a Nested If-Then-Else Statement

How about we consider one model utilizing settled if explanations:

What will be the worth of "Cation"? Reply: "'Number is NEGATIVE!" Did not anticipate that?

Note that the compiler doesn't consider your organizing, you might have composed the above as:

or then again even as (across the board line):

The ";" marks the finish of an assertion.

The compiler will peruse the above assertion as:

or on the other hand to be more exact:

Our ELSE proclamation will be deciphered as a piece of the "inward" IF explanation. The "inward" proclamation is a shut assertion and needn't bother with a BEGIN..ELSE.

Instructions to Fix

To ensure you know how your settled in the event that assertions are treated by the compiler, and to fix the abovementioned "issue", you can compose the underlying form as:

Uh! The monstrous "else" closes the settled if line!? Assembles, takes care of business!

The best arrangement is: consistently use start end matches with settled if proclamations:

A lot of begin-end matches for you? Best to be as careful as possible. In any case, Code Templates are intended to add regularly utilized skeleton designs to your source code and afterward fill in.

Author Image

كاتب الموضوع : khaleddz

تابعونا على
جميع الحقوق محفوظة ل DZ Delphi developer 2018
Mohon Aktifkan Javascript!Enable JavaScript