• Welcome to Valhalla Legends Archive.
 

hardcore = Asc(P(26)) And 4

Started by Tass, November 13, 2005, 05:03 PM

Previous topic - Next topic

Tass

I seen in many sources for d2 stat strings I see:

        Dim hardcore As Byte
        hardcore = Asc(P(26)) And 4

How does the And modify the byte? What does it do exactly? I can't find any help on google that's why I'm posting here.

Hdx

#1
It praforms a bitwise and operation on it using 4 (00000100)
Information on how it works can be found Here
It will only return 1 of 2 values. 0 or 4. If it returns 4 then the hardcore flag is set, and that charecter is hardcore.
~-~(HDX)~-~

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

Tass