• Welcome to Valhalla Legends Archive.
 

Need help with Flags

Started by TeEhEiMaN, October 27, 2003, 12:02 PM

Previous topic - Next topic

TeEhEiMaN

Does anyone know of a good tutorial on Flags update in a Listview? and all that stuff?

VB

bmwrb16

VB 6
      If (Flags And BNFLAGS_OP) = BNFLAGS_OP Then
               frmMain.lvChannel.ListItems.Remove frmMain.lvChannel.FindItem(Username).Index
               With frmMain.lvChannel.ListItems.Add(1, , Username, , ICON_GAVEL)
                   .ListSubItems.Add 1, , , GetLagIcon(Ping, Flags)
               End With
       Else
               With frmMain.lvChannel
                   .ListItems(.FindItem(Username).Index).SmallIcon = icon
               End With
       End If

Tuberload

#2
Open up your favorite visual basic book and read the section on the bitwise operators, paying special attention to the AND, &, operator. The AND operator will tell you whether a bit is turned on, 1, or not.
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

bmwrb16

#3
The code above is correct and does what it is supposed to do.

Tuberload

I never said the code above was incorrect. He did however ask for a tutorial, as in something to teach him, on how to make his flags work. You responded with code, which works, and I responded with a way to learn about what you posted. See the difference? How will it help him to use code he may not understand?
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

bmwrb16

Yeah, I didn't know who you were talking to, and he can look it up on MSDN.

iago

Quote from: bmwrb16 on October 27, 2003, 04:28 PM
Yeah, I didn't know who you were talking to, and he can look it up on MSDN.

Stop being a jerk.  You both gave valid answers.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Gangz

If want some help on Flags Look in Bnet docs on the main page...Or you can aim me on Phyc0freek and ill  help you

Adron

Quote from: bmwrb16 on October 27, 2003, 03:00 PM
The code above is correct and does what it is supposed to do.

It is not however a tutorial so it's obviously completely utterly failing to answer a question asking for a tutorial instead of a code sample.

UserLoser

#9
http://www.valhallalegends.com/arta/docs/flags.txt

Quote
      If (BattleNetFlag And FlagValue) = BattleNetFlag Then
         ' flag is set
      Else
         ' flag is not set
      End If

if the flag's set, update the icon on your listview, if not, leave it how it is

Etheran

Quote from: Tuberload on October 27, 2003, 02:52 PM
Open up your favorite visual basic book and read the section on the bitwise operators, paying special attention to the AND, &, operator. The AND operator will tell you whether a bit is turned on, 1, or not.
bitmasking is the term, I believe.  (just in case you want to look this up)

bmwrb16

#11
Quote from: Gangz on October 27, 2003, 04:42 PM
If want some help on Flags Look in Bnet docs on the main page...Or you can aim me on Phyc0freek and ill  help you

He wasn't asking for help with the flags I think he meant the event.


Quote from: Adron on October 27, 2003, 05:37 PM
Quote from: bmwrb16 on October 27, 2003, 03:00 PM
The code above is correct and does what it is supposed to do.

It is not however a tutorial so it's obviously completely utterly failing to answer a question asking for a tutorial instead of a code sample.

Well his question was kind of ambiguous so I just gave a code sample of the "flagsupdate_event".

Quote from: UserLoser on October 27, 2003, 05:43 PM
http://www.valhallalegends.com/arta/docs/flags.txt

Quote
     If (BattleNetFlag And FlagValue) = BattleNetFlag Then
        ' flag is set
     Else
        ' flag is not set
     End If

Basically what i said, the code I posted covers all the flags if your "GetIconCode" function is made properly


Quote from: Etheran on October 27, 2003, 05:52 PM
Quote from: Tuberload on October 27, 2003, 02:52 PM
Open up your favorite visual basic book and read the section on the bitwise operators, paying special attention to the AND, &, operator. The AND operator will tell you whether a bit is turned on, 1, or not.
bitmasking is the term, I believe.  (just in case you want to look this up)

Not really since bitmasking is different then bitwise.

Etheran

#12
QuoteNot really since bitmasking is different then bitwise.
bitmasking is a bitwise function?

QuoteBasically what i said, the code I posted covers all the flags if your "GetIconCode" function is made properly
btw, you mean MY GetIconCode function.