Categories > Coding > C# >

[Q] How to use the isArchAttached?

Posts: 1598

Threads: 166

Joined: Apr, 2021

Reputation: 13

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

  • 0

Random quote here...

Posts: 0

Threads: 0

Joined: ?

Reputation:

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.

  • 0

chr1srbx

Developer @ Hydrogen

vip

Posts: 374

Threads: 20

Joined: Sep, 2020

Reputation: 22

Replied

this site makes me come back even if i want to take a break..

 

Add () after isArchAttached.

  • 0

banan

Posts: 1598

Threads: 166

Joined: Apr, 2021

Reputation: 13

Replied

@63568 edit: nevermind! found out anyways c:

  • 0

Random quote here...

chr1srbx

Developer @ Hydrogen

vip

Posts: 374

Threads: 20

Joined: Sep, 2020

Reputation: 22

Replied

@VoidableMethod

textname.ForeColor = "color";

guessing that you are in Winforms.

  • 0

banan

Posts: 0

Threads: 0

Joined: ?

Reputation:

Replied

@VoidableMethod ...you can google that up

  • 0

Bones

deez nuts

Posts: 288

Threads: 6

Joined: Mar, 2021

Reputation: 11

Replied

isArchAttached is an Function, so you need to add these to it:

isArchAttached()
  • 0

Who's Deez?

Wabz

Winning.js

Posts: 1968

Threads: 143

Joined: Apr, 2020

Reputation: 27

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");

}

  • 0

My new discord is Wabz#1337 with ID 777154062789509130

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )