Author Topic: kid has even more questions about TS  (Read 4207 times)

do you understand object oriented programming? nmh_type is the object type and :: indicates the function name coming after it is a method on said object type

when we declare function NMH_Type:send(%this) we override the default, but that'd be bad because then we couldn't chat with people
so when we use Parent:send(%this); it calls the method that we overwrote (the version before we overwrote) with the arguments

NMH_Type is some kind of object with the method send(%theNMH_TypeObject)

not entirely sure why we must use :: instead of ., probably to show that we're overriding that specific method and not getting a field

when we declare function NMH_Type:send(%this) we override the default, but that'd be bad because then we couldn't chat with people
so when we use Parent:send(%this); it calls the method that we overwrote (the version before we overwrote) with the arguments

NMH_Type is some kind of object with the method send(%theNMH_TypeObject)

not entirely sure why we must use :: instead of ., probably to show that we're overriding that specific method and not getting a field
alright thanks

oh stuff im handicapped
so it should be
Code: [Select]
if ((%msg $= "*^ENABLE) & (%name $= "Stefan Burnett"))
{
which defautls to
Code: [Select]
if ((1) & (1)) {
which is true
damnit
Remember that the and operator is actually 2 ampersands (&&) so that won't work right.

Remember that the and operator is actually 2 ampersands (&&) so that won't work right.
it will work
& is boolean and, which does work for boolean statements (because they always return 1 or 0)
if they returned an int it would be a bit more iffy

parent::(function)() is used in packages to call the original version of the function you've packaged.

also in your previous attempts you used & instead of &&. & is a bitwise and, to work with bits, while && is a standard conditional and, which is the one you use for if statement conditions.

((nvm conan and phflack explained it and i didn't see there was a second page))
« Last Edit: December 12, 2017, 02:27:39 AM by Vitawrap »


it will work
& is boolean and, which does work for boolean statements (because they always return 1 or 0)
if they returned an int it would be a bit more iffy
& will work, but I would argue that unless he understands why it works, he should use &&

meant to add that while it would work, && is more correct for the situation and should be used