C
C#16mo ago
AideedSS

❔ ✅ Why is this true?

I want to check as if file.Length less than 10000..but why do the expression is true, file.Lenght is more than 10000
40 Replies
ero
ero16mo ago
it isn't
AideedSS
AideedSS16mo ago
yeah, exactly...what when wrong with the code? if it is false, then the debug would turn red
ero
ero16mo ago
i don't know, you're not really telling us what's happening
AideedSS
AideedSS16mo ago
okay, the code is
if(file.Length < 10000){
continue;
}
if(file.Length < 10000){
continue;
}
based on the picture I mention, it represent file.Length is 1493519..which is more than 10000.. Supposedly, it will be false, yet it turns out true.. My question is why? and how to solve this? _ wait, you guys can see the picture I gave right? because, the picture explains everything that I dont even need to put any description 😆 That would be awkward if you don't gets the picture hahaha
SG97
SG9716mo ago
does it actually enter the if clause
ero
ero16mo ago
it doesn't turn out true, that's just not possible
AideedSS
AideedSS16mo ago
exactly yep...it does..I dont want it to turn true..I want that scenario goes false
AideedSS
AideedSS16mo ago
AideedSS
AideedSS16mo ago
take a look on this picture
SG97
SG9716mo ago
can you provide some proof
ero
ero16mo ago
it cannot enter the if clause. that is not possible.
Cattywampus
Cattywampus16mo ago
you're iterating there, so you're not just comparing 1 string
AideedSS
AideedSS16mo ago
wait? compare string? I made a condition between both are value.. 😕
ero
ero16mo ago
they didn't read your code right you're fine
AideedSS
AideedSS16mo ago
In case you don't know, Visual Studio .NET will made debug info red if it is false
ero
ero16mo ago
no it doesn't?
AideedSS
AideedSS16mo ago
hahaha, then how to make them right? hahaha 😆
SG97
SG9716mo ago
what are you talking about if you're looking at local variables, the red indicates it's changed this is assuming we're talking about the same thing but on the matter at hand, can you provide a screenshot where it actually enters the if clause
AideedSS
AideedSS16mo ago
I mean this
SG97
SG9716mo ago
changed, not true/false
ero
ero16mo ago
what part of that indicates true or false lol
Buddy
Buddy16mo ago
Buddy
Buddy16mo ago
This means it HIT that logic check it does not mean it evaluates to true
AideedSS
AideedSS16mo ago
I mean, take a look down there..not there haha
SG97
SG9716mo ago
all I want to see is you running to line 53 and showing the local variables
AideedSS
AideedSS16mo ago
AideedSS
AideedSS16mo ago
alright, wait
Buddy
Buddy16mo ago
Nothing here states that it evaluates to true
AideedSS
AideedSS16mo ago
SG97
SG9716mo ago
?
Buddy
Buddy16mo ago
set a breakpoint at line 54
ero
ero16mo ago
i'm about to explode
SG97
SG9716mo ago
lmao
AideedSS
AideedSS16mo ago
alright
Buddy
Buddy16mo ago
If it does break at line 54, that means that condition evaluates to true, otherwise it would not have hit that breakpoint.
AideedSS
AideedSS16mo ago
thats weird, it skips rarararara.pdf(you can see the filename down there) but when I remove if clause, it does run along with rararrarara.pdf
SG97
SG9716mo ago
why would that be?
AideedSS
AideedSS16mo ago
AideedSS
AideedSS16mo ago
ohhh, i figure it out thanks for helping...the issue is the below codes...
Accord
Accord16mo ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.