From the course: Grasshopper and Rhino: C# Scripting
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Variables
- [Instructor] In C sharp, we use variables to store information. Variables are simply identifiers, that point to a reserve space in memory in which we can store values or data such as numbers, letters or objects. Every time we create a new variable, we're essentially reserving a space in memory to store something. Think of a variable as a bucket, which can store whatever object we like. Whenever we need to find some piece of data, we simply look at the appropriate bucket or variable, which contains the value. In a new grasp of fall. Let's go ahead and place a new C sharp component and then open it up. Within the run script method of our component, let's start by creating our first variable, which will store reference to a new point. To create a variable we need to start with the type of object it will store. A C sharp is what we call a statically-typed language. Meaning the variable data type needs to be…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Commenting2m 27s
-
(Locked)
Variables5m 1s
-
(Locked)
Numbers6m 36s
-
(Locked)
Strings5m 37s
-
(Locked)
Collections5m 34s
-
(Locked)
Arrays5m 32s
-
(Locked)
Comparing with operators5m 3s
-
(Locked)
Conditionals3m 30s
-
(Locked)
Logical operators6m 26s
-
(Locked)
Looping with the for loop5m 23s
-
(Locked)
Foreach looping4m 29s
-
(Locked)
Nested loops5m 12s
-
(Locked)
Methods6m 5s
-
(Locked)
Reference vs. value types5m 21s
-
(Locked)
Try and catch4m 14s
-
(Locked)
-
-