- Beginning C# 7 Hands-On:Advanced Language Features
- Tom Owsiak
- 124字
- 2021-07-02 15:29:25
Comparing values
In the next stage of the process, we will compare values. To do this, enter the following after the closed curly brace/semicolon beneath the preceding line:
sampLabel.Text = CompareValuesInList(compareValues, doubleVals[0], doubleVals[1], doubleVals[2]).ToString();
Here, CompareValuesInList is a function that you can create. Then you'll pass in compareValues. In other words, when this line says compareValues, the entire CompareValues block from above will be passed into the body of the function. You've never done this before. You're passing around entire blocks of code! Next, you enter doubleVals[0] to get the first value, and then you can copy (Ctrl + C) and repeat this for the other ones at index 1 as doubleVals[1] and at index 2 as doubleVals[2] because there are three of them.
推薦閱讀
- 數據庫系統教程(第2版)
- Objective-C Memory Management Essentials
- 自制編譯器
- Responsive Web Design with HTML5 and CSS3
- JavaScript+jQuery開發實戰
- 營銷數據科學:用R和Python進行預測分析的建模技術
- MATLAB實用教程
- MySQL數據庫管理與開發(慕課版)
- Mastering Android Game Development
- C語言程序設計實驗指導 (第2版)
- Scala Reactive Programming
- RealSenseTM互動開發實戰
- Cocos2d-x Game Development Blueprints
- Practical Responsive Typography
- Puppet Cookbook(Third Edition)