Search found 1274 matches
- Feb 23, 2022 10:28
- Forum: Community Discussion
- Topic: Bugs
- Replies: 115
- Views: 21214
Re: Bugs
Because is not a test at run-time but only a test at compilation-time. (this test only works with a literal value passed to CBOOL) Yes, I understand that, but from an end user's (source code) point of view the distinction isn't logical. So either the test should be extended to run-time or it should...
- Feb 23, 2022 9:18
- Forum: Community Discussion
- Topic: Observations.
- Replies: 138
- Views: 15548
Re: Observations.
I second that.deltarho[1859] wrote: ↑Feb 23, 2022 9:04 I prefer not to see Paul sacked. Furthermore, I would think better of him if he resigned. Being a moderator is by no means easy, and not everyone is up to it. Paul will still be respected as a member. Well, he certainly will be by me.
- Feb 23, 2022 8:58
- Forum: Community Discussion
- Topic: Bugs
- Replies: 115
- Views: 21214
Re: Bugs
@deltarho:
Code: Select all
#define IsTrue(x) iif(x <> 0, -1, 0)
#define IsFalse(x) iif(x <> 0, 0, -1)
- Feb 23, 2022 8:57
- Forum: Community Discussion
- Topic: Bugs
- Replies: 115
- Views: 21214
Re: Bugs
Thanks SARG!
I just tested your code (replacing mine in the lib). Indeed, same result and slightly faster.
Result:
I just tested your code (replacing mine in the lib). Indeed, same result and slightly faster.
Code: Select all
_sb_cbool:
cmp eax, 0
setne al
neg al
movsx eax, al
ret
Code: Select all
main do
print(cbool(10 * 5 + 3)); ' -1
print(cbool(10 * 5 + 3 - 53)); ' 0
end
- Feb 23, 2022 8:19
- Forum: Community Discussion
- Topic: Bugs
- Replies: 115
- Views: 21214
Re: Bugs
IMO, Cast() performs the same operation as CBool(), i.e. intended conversion. For example when casting UByte to Byte, no warning is given: Dim As Byte b = Cast(uByte, 255) print b ' -1 I think FB should at least make an exception for Cast(BOOLEAN, x) because no other datatype will fit a 1-bit dataty...
- Feb 23, 2022 7:23
- Forum: Community Discussion
- Topic: Bugs
- Replies: 115
- Views: 21214
- Feb 23, 2022 7:17
- Forum: Windows
- Topic: For WinFBE users
- Replies: 18
- Views: 2442
Re: For WinFBE users
To avoid double posts, see the conversation here: viewtopic.php?p=290178#p290178
- Feb 23, 2022 7:16
- Forum: Community Discussion
- Topic: Bugs
- Replies: 115
- Views: 21214
Re: Bugs
OK, then I propose the cbool() function be redefined to something much more simple (example from SharpBASIC library): _sb_cbool: push edx push eax mov eax, 0 pop edx cmp edx, eax je .__L0 mov eax, -1 .__L0: pop edx ret Without cast, it converts any numerical expression result or value (whatever eax ...
- Feb 23, 2022 7:11
- Forum: Windows
- Topic: For WinFBE users
- Replies: 18
- Views: 2442
Re: For WinFBE users
So a conversion overflow warning is applied as for any other numeric datatype (Byte, Short, ...) only at compile time (only for a literal value). So why does dim a as byte = 10: print cbool(a) not give a conversion warning? It would seem more appropriate here with an explicit data type than with a ...
- Feb 23, 2022 7:06
- Forum: Community Discussion
- Topic: What are you using FB for and what features do you use most?
- Replies: 62
- Views: 7976
Re: What are you using FB for and what features do you use most?
Pascal has a similar function Copy(). With the definitions of strings and how they are represented by variables in these languages, how do you propose string manipulation should be done?
- Feb 23, 2022 7:00
- Forum: Community Discussion
- Topic: Bugs
- Replies: 115
- Views: 21214
Re: Bugs
The definition under the hood of a Boolean is an 1-bit integer. That should not apply to a function converting a numeric expression to boolean. IOW, Passing 10 to cbool() should not be hindered by the definition of a boolean, but rather converting it to it. Even more so when: dim a as byte = 10: pr...
- Feb 23, 2022 6:53
- Forum: Windows
- Topic: For WinFBE users
- Replies: 18
- Views: 2442
Re: For WinFBE users
Indeed, when converting a variable, it's ok.
Code: Select all
dim a as integer = 10
print cbool(a)
- Feb 23, 2022 6:46
- Forum: Community Discussion
- Topic: Observations.
- Replies: 138
- Views: 15548
Re: Observations.
I asked this forum if moderators actually communicate guidelines with each other when making decisions, or if they act on their own. CoderJeff replied to my post saying that, "of course, we communicate." https://www.freebasic.net/forum/viewtopic.php?p=290031#p290031 The fact that Imortis d...
- Feb 22, 2022 22:01
- Forum: Community Discussion
- Topic: Observations.
- Replies: 138
- Views: 15548
Re: Observations.
It seems that jj2007 thought that he was to get a month's suspension. That is what paul doe told him and later confirmed: https://www.freebasic.net/forum/viewtopic.php?p=290091#p290091 If he remains permanently banned, I will declare war on the moderators. This may be about one moderator in particu...
- Feb 22, 2022 21:42
- Forum: Community Discussion
- Topic: Observations.
- Replies: 138
- Views: 15548
Re: Observations.
On the link Dodicat provided, JJ has posted a screenshot that indeed says that he has been permanently banned. The fact that some moderators are unaware of this means that paul doe may have some explaining to do. If he indeed banned JJ permanently without saying so or consulting the other mods, then...