بازگشت   پی سی سیتی > کامپیوتر اینترنت و شبکه Computer internet > سیستم عامل > ویندوز windows > مقالات آموزش ترفندها... Traning > مقایسه ها > مبانی نرم افزار

پاسخ
 
ابزارهای موضوع نحوه نمایش
  #1  
قدیمی 08-14-2013
DifferenceBetween آواتار ها
DifferenceBetween DifferenceBetween آنلاین نیست.
ربات اتوماتیک
 
تاریخ عضویت: May 2013
نوشته ها: 108
سپاسها: : 0

0 سپاس در 0 نوشته ایشان در یکماه اخیر
Post مقایسه تفاوت های Difference Between “If” and “Else if”

مقایسه تفاوت های Difference Between “If” and “Else if”



“If” vs “Else if”

When operating in the Awk command, there will be common occurrences of the ‘if’ and ‘else if’ statements. It is important to appreciate that Awk supports several conditional statements that control the flow of the program. A thorough evaluation of the conditional statements that are common on this language looks similar to the conditions in the ‘C’ programming language.

In a normal scenario, the statement that is delivered by the program is the one that checks whether the condition is true.  This is done each and every time prior to the action being performed. In the event that the condition is true, the action for which the condition refers to is performed.

The condition that is performed can also be as a result when the action that is referred to being false.

It is important to note that the conditional statement ‘if’ will commonly start with the keyword that is referred to as ‘If.’ The Awk environment supports different types of statements. These include the Awk simple ‘if’ statement, the Awk ‘if- else’ statement and the Awk ‘if–Else-lf’ ladder.

When the Awk simple ‘if’ statement is observed, the reference ought to be a single action. This means that the ‘if’ statement is used to check the conditions. If the condition returns a true value, then it will perform the corresponding action that it prescribes to. In the event that the statement refers to multiple actions and the conditional expression returns a true value, there will be multiple actions that are performed. To ensure that the programming of multiple actions is successful, then the actions need to be enclosed in curly brackets and a separation with a new line should be done. It is important to note that the actions prescribed in multiple ‘if’ statements are performed in the order in which they appear.

The ‘if else’ statement is used for checking data that is entered in the Awk program, even if some of the data does not meet the standards that have been spelled out by some of the preceding statements. The use of this statement is an asset, especially when you are looking to calculate with two data sets, one that does not meet the criteria and one that is above the criteria, as when the calculation of the mean is concerned or even grading of data where there are various variations required, each with its own threshold. It is important to remember that any variable will get appended as soon as every new line receives output for input given. It is therefore of value to start every statement on a fresh line.

The concept of having variables that can be accessed with the ‘if else’ statement is the overall issue that comes with this Awk statement. This statement is therefore used to provide alternatives when a particular value of data is given by the processing of the data. As earlier discussed, formatting of this simple line also requires you to start at a new line to ensure that it runs without much trouble.

Summary

The Awk environments come with different requirements and conditional statements

There are two common statements used by the Awk environments: the Awk ‘if’ statement and the Awk ‘if else’ statement

The language is similar to C programming

‘If’ that refers to a single action only checks to see if the conditions are true, then implements them if so

‘If’ with multiple actions checks conditions, and if true it implements them systematically.

Multiple ‘if’ statements must be accompanied by curly brackets and each statement should start on a single line

‘If else’ is used to offer alternatives for conditional statements which do not meet certain thresholds



You might also like…



پاسخ با نقل قول
جای تبلیغات شما اینجا خالیست با ما تماس بگیرید




پاسخ


کاربران در حال دیدن موضوع: 1 نفر (0 عضو و 1 مهمان)
 

مجوز های ارسال و ویرایش
شما نمیتوانید موضوع جدیدی ارسال کنید
شما امکان ارسال پاسخ را ندارید
شما نمیتوانید فایل پیوست در پست خود ضمیمه کنید
شما نمیتوانید پست های خود را ویرایش کنید

BB code is فعال
شکلک ها فعال است
کد [IMG] فعال است
اچ تی ام ال غیر فعال می باشد



اکنون ساعت 08:29 AM برپایه ساعت جهانی (GMT - گرینویچ) +3.5 می باشد.



Powered by vBulletin® Version 3.8.4 Copyright , Jelsoft Enterprices مدیریت توسط کورش نعلینی
استفاده از مطالب پی سی سیتی بدون ذکر منبع هم پیگرد قانونی ندارد!! (این دیگه به انصاف خودتونه !!)
(اگر مطلبی از شما در سایت ما بدون ذکر نامتان استفاده شده مارا خبر کنید تا آنرا اصلاح کنیم)


سایت دبیرستان وابسته به دانشگاه رازی کرمانشاه: کلیک کنید




  پیدا کردن مطالب قبلی سایت توسط گوگل برای جلوگیری از ارسال تکراری آنها