Warnings are coming...

Erel

B4X founder
Staff member
Licensed User
Longtime User
The next version will include a new "warning engine". The purpose of this engine is to help by finding common programming mistakes.

SS-2013-04-21_17.35.46.png


Errors and warnings will be updated whenever you save the project (or choose Test Compile).

Most of the warnings are compile-time warnings. There are however also several runtime warnings. These warnings are only checked in Debug mode.

All the warnings can be disabled easily.

The current list of compile-time warnings:
1: Unreachable code detected.
2: Not all code paths return a value.
3: Return type (in Sub signature) should be set explicitly.
4: Return value is missing. Default value will be used instead.
5: Variable declaration type is missing. String type will be used.
6: The following value misses screen units ('dip' or %x / %y): {1}.
7: Object converted to String. This is probably a programming mistake.
8: Undeclared variable '{1}'.
9: Unused variable '{1}'.
10: Variable '{1}' is never assigned any value.
11: Variable '{1}' was not initialized.
12: Sub '{1}' is not used.
13: Variable '{1}' should be declared in Sub Process_Globals.
14: File '{1}' in Files folder was not added to the Files tab.\nYou should either delete it or add it to the project.\nYou can choose Tools - Clean unused files.
15: File '{1}' is not used.
16: Layout file '{1}' is not used. Are you missing a call to Activity.LoadLayout?
17: File '{1}' is missing from the Files tab.
18: TextSize value should not be scaled as it is scaled internally.
19: Empty Catch block. You should at least add Log(LastException.Message).
20: View '{1}' was added with the designer. You should not initialize it.
21: Cannot access view's dimension before it is added to its parent.
22: Types do not match.
23: Modal dialogs are not allowed in Sub Activity_Pause. It will be ignored.
 

barx

Well-Known Member
Licensed User
Longtime User
Sounds like an interesting feature. Should help keep errors / debug time to a minimum.
 
Upvote 0

HCAZ

Member
Licensed User
Longtime User
This sounds great, cant wait for it to come out.
Will the underlines be different colours for different errors?
Like Warning / Error type of thing?
 
Upvote 0

imbault

Well-Known Member
Licensed User
Longtime User
Very interesting feature Erel.

What else can we expect with this new release???

Bravo.

Patrick
 
Upvote 0

clewgsm

Member
Licensed User
Longtime User
Hi Erel,

it would be very useful also having a new option (in the Tools Menu) that allows to execute small scripts, i.e. something like "adb logcat -c", etc..
Do you think is it feasable ?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Will the underlines be different colours for different errors?
Errors will be colored red. The current implementation fails on the first error. So when there is a compilation error, only this error will be displayed.

Also, you should be using DIP on line #30 (sorry couldn't resist)
:) For that we have warning #6.

What else can we expect with this new release???
Things are not 100% close yet. Two new major features:
- Smart management of bitmaps to help avoid out of memory exceptions.
- Ability to add custom classes / libraries with the designer. In this version the designer will not show the actual custom view (due to technical limitations of loading classes at runtime) however it will still be very useful for visually building the layout.

There are many other "smaller" improvements planned.
 
Upvote 0

mebcs

Member
Licensed User
Longtime User
Excelent

I always have trouble finding dead code (Unused routines and variables). Looking forward to release.
 
Upvote 0

Beja

Expert
Licensed User
Longtime User
Great as usual'
Also hope next vesion will include installer that automates all the steps.
 
Upvote 0
Top