Android Question If Statement bug

Scantech

Well-Known Member
Licensed User
Longtime User
This is actually a bug i spotted with statement being true based on adding a log or not.

Try attached file.

Follow these steps

  1. Disable the log("THIS WILL TRIGGER TRUE STATEMENT")
  2. Run the app
  3. observe the Value (Value = "Im False Statement")

  1. Now, Enable the Log("THIS WILL TRIGGER TRUE STATEMENT")
  2. Run the app
  3. observe the Value (Value = "IM True Statement")

This is only caused by not using
lv = GetDeviceLayoutValues

Even if not using it, it should not cause statement issues as i observed.

There should be a warning message or something

MUST use with 10inch Emulator
 

Attachments

  • If Statement.zip
    8.2 KB · Views: 235
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
Moved to the questions forum.
It is not related to the log command or the if statement. Accessing an uninitialized LayoutValues object is a programming mistake. Your code causes a division by 0.

The difference in the behavior is related to the debugger pipeline. You can see it by cleaning the project after you make a change.

Anyway, I will make this method (ApproximateScreenSize) throw an exception when the Scale is zero.
 
Upvote 0
Top