Re: User Object USER_DELETEDã > By: Mortifis to All on Tue Jul 23 2019 12:52:15ãã > Mo> I am unsure how to restore a user with the user.settings.USER_DELETEDã > Mo> or restore a USER_INACTIVE any help would be appreciatedãã > user.settings &=~ USER_DELETED;ãããinteresting ... that &=~ ... undeletes? no wonder USER_DELETED = 0 didn't workã... thought it was a BOOLEAN o.oããMy doctor said I have the body of a 25 year old ... and the mind of a 10 :-/ãã---ã þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81ã
Re: User Object USER_DELETEDã > By: Mortifis to All on Tue Jul 23 2019 12:52:15ãã > Mo> I am unsure how to restore a user with the user.settings.USER_DELETEDã > Mo> or restore a USER_INACTIVE any help would be appreciatedãã > user.settings &=~ USER_DELETED;ããas learning any language ( obviously I am not C adept) what does ~& or evenãjust ~ mean negate a bitwise?ãããMy doctor said I have the body of a 25 year old ... and the mind of a 10 :-/ãã---ã þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81ã
Re: Re: User Object USER_DELETEDã > By: Mortifis to echicken on Tue Jul 23 2019 22:40:15ãã > Mo> as learning any language ( obviously I am not C adept) what does ~& orã > Mo> even just ~ mean negate a bitwise?ãã > https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/ã > Bitwise_Operatorsãã > '~a' inverts the bits of 'a'ãã > 'a & b' returns ones in positions where both 'a' and 'b' have onesãã > 'a & ~b' returns ones in positions where both 'a' and the inverse of 'b'ã > have onesãã > 'a &= b' assigns the result of 'a & b' to 'a'ãã > 'a &= ~b' assigns the result of 'a & ~b' to 'a'ãã > 'a | b' returns ones where either 'a' or 'b' have onesãã > 'a |= b' assigns the result of 'a | b' to 'a'ãã > So:ãã > var a = 1; // 00000001ã > var b = 2; // 00000010ã > a |= b; // a = 00000001 | 00000010ã > a &= ~b; // a = 00000011 & 11111101ãã > if that makes sense.ããhuh! starting to ... kinda reminds me of 8 bit assembly, thank you, waking myãbrain up again after years of octal sleep :-oããMy doctor said I have the body of a 25 year old ... and the mind of a 10 :-/ãã---ã þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81ã
Re: User Object USER_DELETEDã > By: Mortifis to All on Tue Jul 23 2019 12:52 pmãã > > I am unsure how to restore a user with the user.settings.USER_DELETED orã > > restore a USER_INACTIVE any help would be appreciatedãã > USER_DELETED and USER_INACTIVE are bit flags. An integer can hold many bitã > flags (typically, 32). In the case of user.settings, each bit as aã > pre-defined purpose and those bits have been assigned symbolic names (inã > userdefs.js).ãã > To set (add) a bit-flag, you bit-wise "OR" it into the value, like so:ãã > user.settings |= USER_DELETED;ãã > To unset (remove) a bit-flag, you bit-wise "AND" it with the oppositeã > (bit-wise not) value, like so:ãã > user.settings &= ~USER_DELETED;ãã > Hope that helps,ãã > digital manããVery helpful ... sorry for taking so long to reply, I was having QWK issuesãããMy doctor said I have the body of a 25 year old ... and the mind of a 10 :-/ãã---ã þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81ã
Sysop: | Karloch |
---|---|
Location: | Madrid, Spain |
Users: | 78 |
Nodes: | 8 (0 / 8) |
Uptime: | 63:09:44 |
Calls: | 1,390 |
Calls today: | 1 |
Files: | 17,895 |
D/L today: |
8 files (174K bytes) |
Messages: | 66,281 |