DAY 040: _TOGGLEBIT
#3
(12-19-2022, 08:32 PM)mnrvovrfc Wrote: This is one keyword that tells me that "AS _BIT" is worthless. Cannot be the return value of a function which turned me off straight away and forced me to use "AS _BYTE" which I don't like neither. Also the other-worldly behavior of "NOT" caused me to reject "AS _BIT".

"_TOGGLEBIT" and the others are just easier, don't even have to declare an array to have up to 64 on/off switches. Now only if we were all more consistent about ON or OFF, ZERO or ONE, TRUE or FALSE, YES or NO, MALE or FEMALE, BLACK or WHITE... maybe not that last one but it could describe some people with one-track minds.

What're you talking about??  There's no problem with using a BIT as a return value for a Function.

Code: (Select All)
Print foo("True")
Print foo("False")

Function foo` (Truth As String)
    If Left$(UCase$(_Trim$(Truth)), 1) = "T" Then foo = 1
End Function

Is there something I'm missing here?
Reply


Messages In This Thread
DAY 040: _TOGGLEBIT - by Pete - 12-19-2022, 07:43 PM
RE: DAY 040: _TOGGLEBIT - by mnrvovrfc - 12-19-2022, 08:32 PM
RE: DAY 040: _TOGGLEBIT - by SMcNeill - 12-19-2022, 08:43 PM
RE: DAY 040: _TOGGLEBIT - by mnrvovrfc - 12-19-2022, 09:37 PM
RE: DAY 040: _TOGGLEBIT - by SMcNeill - 12-19-2022, 09:05 PM
RE: DAY 040: _TOGGLEBIT - by Pete - 12-19-2022, 09:17 PM
RE: DAY 040: _TOGGLEBIT - by SMcNeill - 12-19-2022, 09:47 PM
RE: DAY 040: _TOGGLEBIT - by Pete - 12-19-2022, 10:03 PM
RE: DAY 040: _TOGGLEBIT - by SMcNeill - 12-19-2022, 10:22 PM
RE: DAY 040: _TOGGLEBIT - by Pete - 12-19-2022, 10:30 PM
RE: DAY 040: _TOGGLEBIT - by SMcNeill - 12-19-2022, 10:42 PM
RE: DAY 040: _TOGGLEBIT - by bplus - 12-19-2022, 11:20 PM
RE: DAY 040: _TOGGLEBIT - by Pete - 12-19-2022, 11:22 PM
RE: DAY 040: _TOGGLEBIT - by Jack - 12-19-2022, 11:58 PM
RE: DAY 040: _TOGGLEBIT - by Pete - 12-20-2022, 01:11 AM
RE: DAY 040: _TOGGLEBIT - by vince - 12-20-2022, 01:59 AM
RE: DAY 040: _TOGGLEBIT - by OldMoses - 12-20-2022, 03:46 AM



Users browsing this thread: 2 Guest(s)