TAILIEUCHUNG - Controlling a Script's Flow

Thông thường, hành động trong kịch bản của bạn thực hiện liên tục, từ đầu đến cuối, một chuỗi đại diện dòng lệnh của bạn. Sử dụng logic có điều kiện, bạn có thể kiểm soát dòng chảy này bởi kịch bản hành động cụ thể để thực hiện chỉ khi điều kiện cụ thể được đáp ứng hoặc tồn tại trong phim của bạn. Bằng cách thực hiện điều kiện logic trong kịch bản của bạn, bạn cho phim của bạn khả năng đưa ra quyết định và hành động dựa trên các điều kiện khác nhau mà bạn. | Controlling a Script s Flow Typically actions in your scripts execute consecutively from beginning to end a sequence that represents your script s flow. Using conditional logic you can control this flow by scripting specific actions to execute only when specific conditions are met or exist in your movie. By implementing conditional logic in your scripts you give your movie the ability to make decisions and take action based on various conditions you ve set and your movie takes on more dimension as a result. You ll use the conditional statements or phrases described in this lesson to implement conditional logic in your scripts. If Then Statements At the heart of conditional logic is the simple if then statement. Here s an example if moneySaved 500 buyStuff next line of actions. The buyStuff function is called only if the variable moneySaved has a value greater than 500. If moneySaved is equal to or less than 500 the buyStuff function call is ignored and actions immediately below the if statement are executed. At its core a conditional statement looks at a circumstance placed within parentheses and determines whether that circumstance is true or false. If the circumstance is true actions within the statement are executed if the circumstance is false the actions are ignored. When you create an if statement you state essentially if .what is shown here is true Do this The data you place within parentheses represents the condition to be analyzed. The data within the curly braces represents the actions to be taken if the condition exists. As in real life sometimes an if statement needs to analyze multiple conditions before taking a single action or set of actions. For example if moneySaved 500 billsPaid true buyStuff The AND operator has been added to the statement so that now the buyStuff function is called only if moneySaved is more than 500 and billsPaid has a value of true. If either condition is false buyStuff will not be called. Using the OR operator allows you to .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.