B4J Question [ABMaterial] Moving on to Version 2 Help Please!!!

Mashiane

Expert
Licensed User
Longtime User
Hi there

I'm currently struggling porting my ABMaterial WebApp to version 2.

I have changed the ABMDatePicker, ABMActionButton, which are the only two things that are affected currently, however I am getting an error as depicted below. I even tried this on a single page excluding the rest of the pages, nothing happens.

I dediced to copy one of my page to the demo app, ran the demo making it a start page, it worked! I was excited, then subsequent runs just didnt work, giving the same error.

Can someone please advise what could I be doing wrong here..

 

alwaysbusy

Expert
Licensed User
Longtime User
This can have several reasons, mostly to do with programming styling (hope I solved all of them in 2.02). This happens with some code I wrote in preparation for B4JS, but causes trouble in 2.00. I've catched a lot of programming styles, but these have slipped through the net:

1. You have somewhere a method defined like this:

sub methodname as String

end sub

Workaround: add brackets to the method

sub methodName() as string

end sub

2. You are using "_" to split a B4J line

page.AddRowsM( 10, True, 4, 4, "" ).AddCellsOS(1, 0, 0, 0, 12, 6, 6, "") _
.AddCellsOS(1, 0, 0, 0, 0, 6, 6, "")

The workaround is to write as a single line.

page.AddRowsM( 10, True, 4, 4, "" ).AddCellsOS(1, 0, 0, 0, 12, 6, 6, "").AddCellsOS(1, 0, 0, 0, 0, 6, 6, "")

3. You have a .BAS file in your project folder that is not being used in the project itself (an old version, a copy, a removed class, etc)

The workaround: remove this file from your project folder

If none of these are the cause in your case, please add a Log(Page.Name) in the AddPage() method in ABMApplication class. Check on which .bas it fails and mail me the .bas file (zipped). I'll have a look at what else could've cause it.
 
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
This fix (2.0.2) would've gone out some time ago, but there is still some uncertainty on another case (re-connections). I would love to have some more feedback first on this from the mini team I assembled to check this case. It is all a matter of days now.
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
I hope to have my project up to 2.01 and tested today on the slow sat connection.
With the inclusion of Google Charts in my webapp, we shall see how responsive it is.
 
Upvote 0

stanmiller

Active Member
Licensed User
Longtime User

This is the ABM analyzer glitch I've wrote about. The analyzer doesn't report filenames or line numbers so you don't know where to put a workaround.

@alwaysbusy

Perhaps you could add a switch to disable the analyzer to workaround these situations. Then offer a method to manually declare what the analyzer is looking for. (e.g. page.NeedsCombo = True )

.
 
Upvote 0

mindful

Active Member
Licensed User
Then offer a method to manually declare what the analyzer is looking for. (e.g. page.NeedsCombo = True )
Those methods already exist : https://www.b4x.com/b4j/help/abmaterial.html#abmpage_needsactionbutton

Perhaps you could add a switch to disable the analyzer to workaround these situations.
If this will happen then you will have a lot of other questions or "problems" that will occur because you do not know the insights of ABMaterial and the only one able to answer will be AB. It's a 90% chance that every piece of big software contains bugs and it's a 5-10% chance that bugs can be handled temporarely with a workaround and not with issuing a new version. AB already stated in the other post (https://www.b4x.com/android/forum/threads/abmaterial-how-to-create-a-fixed-header.72830/#post-464147) that: "I can build-in a setting to disable the ABM Analyser if you want, but then YOU will have tell in you app with the page.needs... properties which components you use in your page, read console logs in the browser to see which page.needs... you missed, and won't be able to use new features like B4JS in the future." - No need to make it your ideea (this is how it seems to me).

I don't like to take sides with anyone but like you I have some wishes for ABMaterial and have to wait for 2.02 to come and will have other wishes in the future. AB didn't state anywhere that ABMaterial bugs or wishes will be resolved in 24 hours. The software is donationware (please see below a short description of what donationware is) and B4J is free. Some people still use previous versions, some people use the free vresion that is provided.

So after reading your posts (this and those in the other thread) I decided that I too have an opinion and as this is a community I would like to speak my mind: your post (this one from above) doesn't help anyone !

I have been in this business (programming) about 14 years and I am only 30 now . Until B4J and ABMaterial I have paied for every version of VisualStudio Professional (starting for VS2003). And I bought quite a few components/libraries which cost much more than the IDE and I can tell you that those software contained bugs which rarely could be fixed with workarounds. I even bought software that went out of business (VisualWebGUI). I think you all get the point where I am going with this ...

I am deeply happy with B4J and ABMaterial. Just think how much work and time you would have put in writing html, css and js yourself when instead its generated in less than 5 seconds and setting the server from the IDE, not having to deal with apache/iis config files is a breakthrough. In my opinion B4J is real proof that this community is stable - its a free product made to make life easier for its members and ABMaterial makes all nightmares go away for us (BASIC lovers) - this dosen't mean that I do not know how to code in other languages - I am not just that confortable.

I started using B4J and ABMaterial just a month and a half ago. B4J is my first use for a B4X product, but I donated for ABMaterial 8 months ago because I saw it's potential. I don't use B4A, but I bought it a month ago because I want to support this community anyway I can and will definitely recommend B4X and ABMaterial to everyone I meet sharing this profession ...

I really hope this post hasn't offended anyone. I just wanted to make a point that B4J and ABMaterial fit perfectly one to each other and they are commercial grade products but they are free and the support for this products is free and this forum contains more knowledge and ideeas than any other programming language book I've read.

I am sorry for the offtopic (especially @Mashiane).
Thank you @Erel for B4X. Thank you @alwaysbusy for ABMaterial. Thank you all for the work you've put in this community.

Keep up the good work and happy programming ...


DonationWare:
Donationware offers an alternative model for those who want to collect money to offset the cost of creating software products. One way to think about donationware is that a developer or small company can operate on a lean business model where, instead of paying for all of the costs involved in selling software, developers can simply distribute programs for free and ask for donations from users to cover nominal costs. Because the upfront, overhead cost is lower, those who make donationware may be able to recoup costs through donations. Donationware also helps get around the issue of piracy.

Donationware can also be a way to promote a particular design philosophy in IT that could be called collaborative. One example is the Ubuntu Linux product offered by Canonical. The idea is that while users often get involved in the development of software through testing, providing input, or otherwise interacting with software products, they can also assist by effectively crowdfunding a new software product or version.
 
Last edited:
Upvote 0

Harris

Expert
Licensed User
Longtime User
@mindful - Thanks for your input. I too (as others) have paid big money for dev crap. B4X (and associates) is a gift. All in this community know that. They have been there, done that (pinch themselves every day to remind them what they have)...

I don't think @stanmiller is actually blaming or blasting anyone (as it may seem), but rather venting frustration with his real world projects and deadlines. I often speak out of turn, then feel bad when I hear the response from the community (knowing I should have never posted the personal BS in the first place).
When reading what offends you (or potentially others), think - "Thick Skin" and "With a Grain of Salt". I didn't see a rule for this forum stating - "No Venting". Sometimes, strongly worded, harsh feedback is helpful (as long as we don't take it personally). Anyone raised in a military family knows what this is all about (not saying it is right - but a culture).

We all wish our dev environments would be bug free - but we all can't be @Erel !

On another note:
I have just had time to update my app to pre 2.01 - and am having serious issues. I have emailed ab, and when he rises (opposite time zones), he will read what I have encountered. Sorry to hold everyone up - but often life gets in the way. Soon, all this will be mute.

Thanks
 
Upvote 0

stanmiller

Active Member
Licensed User
Longtime User

I haven't been back to fixed header thread so I missed the comment from AB.

As a Visual Studio user you may have used the C/C++ compiler's many optimization settings which allow one to toggle this or that optimization off because of an issue with a routine (e.g. the compiler gets too aggressive and misinterprets the codes intentions). You might toggle the setting via the command line or inline with pragmas.

Even B4J has the ability to change the behavior of the debugger.

#DebuggerDisableOptimizations

By providing the ability to toggle the analyzer on/off. Or maybe toggle parts of the analyzer behavior allows AB to continue developing features of the analyzer (say... as needed for the Abstract designer) while minimizing the impact on existing projects.

Code will never be perfect but these are strategies developers use to mitigate an imperfect world.
 
Upvote 0

stanmiller

Active Member
Licensed User
Longtime User

We own multiple licenses for B4A and B4I, have published apps on both Play and iTunes, and like you are ABM donors.

Follow this link to our B4X open source project. We're planning to put a live demo of the compiler online with ABM sometime soon.

B4X Expression Compiler and Eval Library
https://github.com/macthomasengineering/mteeval-b4x-library
 
Upvote 0

Harris

Expert
Licensed User
Longtime User

Clipper! That is where I cut my teeth. Loved it...
I wrote many projects in that dev environment. It had a large community following - for those days. It reminds me of B4X - it worked (after I replaced the paradox DB and used a stable replacement (dam index corruption and lock files))!

After the death of Clipper (name escapes me who bought them out (Object....) - and killed a windows version), I embraced Delphi.
Wish I had the money back I spent on all this stuff - I could pay my mortgage for the next six months!

For what I need to pay now, I just collect bottles out of the ditch and cash them in (along with my own... he he).

Image - my mouse pad.
 
Last edited:
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
First, no need to start arguing with each other. This is a team effort and we'll get there. I really understand some frustrations as I have them too with other programming tools. I think this is kind of an exceptional situation we're in as two things happened unfortunately at the same time: my changes to the B4J Analysing algorithm to prepare for future enhancements like B4JS and the problem some have with reconnecting. Mindful is doing an exceptional job helping and investigating problem two (THX!)

I added the following in 2.02:

In ABMApplication Initialize() set ABM.AnalyserDisableAll = True
This will skip the analyse all together. Future B4JS will not work and you'll need to add all the .Needs... manually.

Additional (if you leave it enabled), a file B4JAnalyse.log is created in the /Objects/ folder. You can use this to find out at which line the Analyser had a FATAL crash. (a hint only, as the actual line it is analysing has been cleaned up, removed from strings and smartstrings etc):

Example output: (this is a theoretical example, as for the love of God, I've been trying to create an error in Analysing in 2.02 for the last two hours and I can't)
B4X:
...
ABMShared.bas[27]  jo.InitializeStatic( {8} )
ABMShared.bas[28]  jo.RunMethod( {9} , Array(ps))
ABMShared.bas[29]  jo.RunMethod( {10} , Array(ps))
ABMShared.bas[30]  #end if
ABMShared.bas[31] End Sub
ABMShared.bas[32]
ABMShared.bas[33] ' build methods for ABM objects
ABMShared.bas[34] Sub BuildTheme As String

for some non fatal errors, I'll try to build in errors in the log, e.g.

ERROR PARSING LINE: ABMShared.bas[34] Private Sub BuildTheme As String

The last line would have caused an error in ABMaterial 2.00, in 2.02 it will show this error.
 
Last edited:
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User

Cool! In our company we use a similar library to do evaluations:

B4X:
Sub Process_Globals
   Private fx As JFX
   Private MainForm As Form
End Sub

Sub AppStart (Form1 As Form, Args() As String)
   MainForm = Form1   
   MainForm.Show
   
   Dim evaluator As ABEvaluator
   evaluator.Initialize(Me, "eval", "5+ROUND(avg(ref,inp),2,7)")
   ' add a custom function
   evaluator.addFunction("avg", 2)
   evaluator.fillVariables(CreateMap("ref": 5, "inp": 10.0))
   ' evaluate
   Log(evaluator.Eval)   
End Sub

' write your own functions, always return a double
Sub eval_avg(val1 As Double, val2 As Double) As Double
   Return (val1+val2)/2
End Sub
 
Upvote 0

stanmiller

Active Member
Licensed User
Longtime User

I cut my teeth on Clipper as well. After Computer Associates bought Clipper and transformed it into Visual Objects it kinda lost its way. I moved to doing mostly C/C++ projects in embedded systems before getting into technical sales. Only in the last year have I returned to development full-time.

There is definitely a Clipper community feel to the Basic4Anywhere family.
 
Last edited:
Upvote 0

stanmiller

Active Member
Licensed User
Longtime User
Cool! In our company we use a similar library to do evaluations:

Very cool.

Here's what your example would look like with MteEval.
B4X:
Dim cb as Codeblock
cb.Initialize

' Compile
cb.Compile( "{|ref,inp|5+NumberFormat(avg(ref,inp),0,2)}" )

' Eval
Result = cb.Eval2(Array( 56.54, 38.33 ))
Log( "Result=" & Result )  '52.44

' Disassemble
Private CodeListing As List
CodeListing = cb.Decompile
For Each sLine As String In CodeListing
  Log( sLine )
Next

-- Header --
Parameters=2
-- Code --
1:     loadc   ax, 5
3:     push    ax
4:     loadv   ax, varmem[0]
6:     push    ax
7:     loadv   ax, varmem[1]
9:     push    ax
10:    call    avg
10:    pop     2
11:    push    ax
12:    loadc   ax, 0
14:    push    ax
15:    loadc   ax, 2
17:    push    ax
18:    call    numberformat
18:    pop     3
19:    add     stack[sp] + ax
19:    pop   
20:    end

Today, to add custom functions like avg you would need to add the function manually: add a pcode, an entry in the function table, virtual machine, and decompiler. Or one could modify the library to add functions dynamically like you guys have.

We have it on our todo list at Wafffle
https://waffle.io/macthomasengineering/mteeval-b4x-library

.
 
Last edited:
Upvote 0

Harris

Expert
Licensed User
Longtime User
You probably remember the SiXDriver then. I worked for Successware.
Yes, I do remember! The nsx indexes...

Then I moved to DBISAM. Excellent DB replacement. Client/server with no issues.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…