- Joined
- Jul 10, 2007
- Messages
- 6,306
Yea..
We have two types of variables.
Scalar Variables
Handle Variables
Wrong, it's
primitives vs types that extend off of handle
From here, we have
scalars
arrays
lists
etc, essentially
scalars vs collections
a string is actual a collection (an array of chars), making it a pointer (like a handle, although a handle is a *special* kind of pointer). Scalars are non arrays. An array of strings would actually be a 2D array, an array of arrays of chars (char* chars[] in c++).
Now, that's all I've read through the beginning of that lesson, but please fix your information =P.
Posting it in this forum so people can see this post while you are fixing it : )
edit
there is no character type variable, it's just an integer using a different number system..
the number systems in wc3 are decimal, octal, hexadecimal, and ascii. Ascii would be your 1/4 digit character.
edit
As for arrays, it's not that they start at 0, the array is a point to a sequence of information, like a sequence of integers.
[x][x][x][x][x][x]
that'd be an array of size 6, the [] representing the slots and the x representing the possible values stored within it.
The array itself is a pointer. The index adds to this pointer.
If we were to have this
[1][9][2][4][7][3]
Again, an array of size 6, but this time with 6 values, them being 1,9,2,4,7,3, just reading array would give back 1. In JASS, you can't treat an array as a pointer, you always have to use the index notation, which adds to the array pointer. Array[0] would give Array + 0, which is the array's very beginning (you aren't moving forward at all). At the start of the array is the value 1, so it would return 1.
If we wanted to get the second position, which has the value 9, we'd have to move forward by 1. Array + 1 as a pointer would give us the memory address at the value of 9. Array + 1 as a pointer == Array[1], which is once again 9.
So it's not that it starts counting at 0, that's bs. It starts counting at the array pointer : P.
However, I'm not sure how you would teach the above to beginners, hehehe
edit
it's not called variable referral, it's called reading/writing.
To read a variable, you'd just use the variable name. To write to it, you use the = operator. In JASS, this operator also requires the annoying set keyword.
edit
Also, please stop with the "it's incredibly simple," and "it's that easy." It almost sounds like you are insulting whoever is reading it, like... you're too stupid to understand this?? Look at how easy it is! Wow, how stupid can you be? Also, those lines add nothing to your lesson ;p.
We have two types of variables.
Scalar Variables
Handle Variables
Wrong, it's
primitives vs types that extend off of handle
From here, we have
scalars
arrays
lists
etc, essentially
scalars vs collections
a string is actual a collection (an array of chars), making it a pointer (like a handle, although a handle is a *special* kind of pointer). Scalars are non arrays. An array of strings would actually be a 2D array, an array of arrays of chars (char* chars[] in c++).
Now, that's all I've read through the beginning of that lesson, but please fix your information =P.
Posting it in this forum so people can see this post while you are fixing it : )
edit
there is no character type variable, it's just an integer using a different number system..
the number systems in wc3 are decimal, octal, hexadecimal, and ascii. Ascii would be your 1/4 digit character.
edit
As for arrays, it's not that they start at 0, the array is a point to a sequence of information, like a sequence of integers.
[x][x][x][x][x][x]
that'd be an array of size 6, the [] representing the slots and the x representing the possible values stored within it.
The array itself is a pointer. The index adds to this pointer.
If we were to have this
[1][9][2][4][7][3]
Again, an array of size 6, but this time with 6 values, them being 1,9,2,4,7,3, just reading array would give back 1. In JASS, you can't treat an array as a pointer, you always have to use the index notation, which adds to the array pointer. Array[0] would give Array + 0, which is the array's very beginning (you aren't moving forward at all). At the start of the array is the value 1, so it would return 1.
If we wanted to get the second position, which has the value 9, we'd have to move forward by 1. Array + 1 as a pointer would give us the memory address at the value of 9. Array + 1 as a pointer == Array[1], which is once again 9.
So it's not that it starts counting at 0, that's bs. It starts counting at the array pointer : P.
However, I'm not sure how you would teach the above to beginners, hehehe
edit
it's not called variable referral, it's called reading/writing.
To read a variable, you'd just use the variable name. To write to it, you use the = operator. In JASS, this operator also requires the annoying set keyword.
edit
Also, please stop with the "it's incredibly simple," and "it's that easy." It almost sounds like you are insulting whoever is reading it, like... you're too stupid to understand this?? Look at how easy it is! Wow, how stupid can you be? Also, those lines add nothing to your lesson ;p.
Last edited: