Categories > Coding > C# >
[Q] How to use the isArchAttached?
Posted
Hey,
So uhm I'm kinda new to coding things, and I wanted to ask how to make the isArchAttached work. I'm using ArchAPI and I'd like to know more about these type of things. My current code for the isArchAttached is something like that:
if (api.isArchAttached == true)
{
}
And it errors me with that:
Operator '==' cannot be applied to operands of type 'method group' and 'bool'
Any ideas?
Thank you for any type of reply!
Aja <3
Random quote here...
Replied
isArchAttached isnt a variable. It's a function that returns a bool. It should be
if (api.isArchAttached())
NOTE: you dont need to add "== true" it'll still check for it.
Cancel
Post
Replied
this site makes me come back even if i want to take a break..
Add () after isArchAttached.
Cancel
Post
banan
Replied
@63568 edit: nevermind! found out anyways c:
Cancel
Post
Random quote here...
Replied
Cancel
Post
banan
Replied
isArchAttached is an Function, so you need to add these to it:
isArchAttached()
Cancel
Post
Who's Deez?
Replied
The others already helped you out, so i'll just explain you something, if statements will run a code block if what you provide them is a true boolean value. checking for "== true" is therefore useless.
I'm gonna give you an example:
if(true) {
Console.WriteLine("Yes!");
}
Another one:
if(3 > 2) {
Console.WriteLine("Yes");
}
Cancel
Post
My new discord is Wabz#1337 with ID 777154062789509130
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post