CalcTable1.0

Rioven

Active Member
Licensed User
Longtime User
Hello B4ppc members,

CalcTable1.2 is a utility I have created expanding the use of my MathCode2.2.
This application able to process a series of calculation formulas on a table.
This could be very useful in so many computations in your PPC.

This application is compiled in Basic4ppc Version 6.50 Beta
Source Code is also attached.

I have added a function of conditions using similar to MSExcel i.e IF(condition,true,false) i.e. false needs to have value.
Unlike MSExcell in your PPC, this Calctable1.2 is very light and simple and you can actually see your formula and not cellnames.

Other features:
Inputs are not case-sensitive.
There is an Auto backup to other file which you could enable/disable.
The files extension I have used is filename.ct1 and the backup is filename-BAK.ct1.
These files are saved in csv format.
Context menu is also functional.
Supports landscape display orientation.
5-PPC buttons also supported in navigating the table for easy viewing cell contents.


Attachements:
2 samples are attached.

Operators:
+ - / * ^ ( ) ! MOD
INT( ) ABS( ) LN( ) LOG( ) SQRT( )
SIN( ) COS( ) TAN( ) ASIN( ) ACOS( ) ATAN( )
IF(Condition,True,False)
Conditions: <, >, =, <>, >=, <=, OR, AND
Constants:pI=3.415., EX=2.718..
Calculation in Radian mode.

Comments,improvements on my code will be greatly appreciated.
If you found this application useful to you, you may share your calculation files to

me.
Although, I have tested this only for a short period, please help me on bugs.

Thank you very much and more power to Basic4PPC!

EDIT:
-Added LOG( ) and SQRT( ) functions.
-Altered ^ function on negation (sample: -2^2=-4 , (-2)^2=4 ).
-Is now VGA compatible.
 

Attachments

  • CalcTable1.1screenshot.JPG
    CalcTable1.1screenshot.JPG
    51 KB · Views: 485
  • CalcTable1_2SourceCode.zip
    50.4 KB · Views: 269
Last edited:

Rioven

Active Member
Licensed User
Longtime User
WOW!
Looks great.
Did you try to embed the images in the executable instead of a separate file?
It is pretty simple.

I did not, How to do that?
The images were only combined in one file .img using the binaryFile.dll.
 
Last edited:

Rioven

Active Member
Licensed User
Longtime User
:sign0060:
Thanks Erel, that's great!. I didn't know that. I will try...
 

klaus

Expert
Licensed User
Longtime User
Hi Rioven

Pretty nice application !

For the images you can also, in the Designer, directly load the images onto the ImageButtons. They will also be embedded in the exe file. Advantage, you see directly what the button looks like. Of course if you need to change the images on a button you still need an ImageList.

Best regards and congratulations.
 
Last edited:

Rioven

Active Member
Licensed User
Longtime User
Hello Klaus,

Thanks for the advice and the compliment.:)
Can you have a look/try and maybe some help/more advices/develop further this application?:)

With best regards,

P.S. Thanks for your Icon Editor where my icon was created.
 
Last edited:

alfcen

Well-Known Member
Licensed User
Longtime User
When you embed images in the exe or in an image list which results in the same, then all images will be loaded into memory as you start the application irrespective of whether they are currently needed or not. I noticed this as I embedded 8 MB worth of Mars surface map data resulting in an "Out of memory exception" error.

Consequently, I decided to load large map images conventionally when they are called for. Embedding images for Image Bottons is a great choice after all.
 

klaus

Expert
Licensed User
Longtime User
Hello Rioven,

I had a closer look on your application and 'played' a bit with it.

A few comments:
- From my point of view, as a user, I find it somewhat boring for the data input, for me there are too many mouse clicks needed.
- 1. select the cell
- 2. select textbox
- 3. enter data
- 4. click on check button to confirm

couldn't it be
- 1. select the cell, set directly focus on textbox
- 2. enter data
- 3. either
- click on another cell, and the data is confirmed
- click on check button to confirm
In this case if you enter a certain number of data you avoid 2 mouse clicks for each data.

- Some cosmetics
- It could be intersting to save the table column widths when leaving the program, so the user will find the same configuration at the next start of the program.

- The buttons on top, mainly on the desktop, are blurred, this is because the dimensions of the image buttons are different from those of the bitmaps so they are stretched.
Left buttons image buttons 20/20 bitmaps 21/21 pixels
Check button 20/20 bitmap 15/15

As I saw your beam calculation example, are you making civil engineering calculations, it looks like a quite long alluminum beam ?

I saw in your code some variable names, for example J%, this reminds me some 'older basic dialects' where the % suffix meant integer and the $ suffix string variables.

I haven't made many calculations, so from the functionnality and possibility points of view I have no other suggestions.

These comments are suggestions and just one point of view and for shure no critics at all.

Best regards
 

Rioven

Active Member
Licensed User
Longtime User
Hello Klaus, It was really appreciated that you've spent time to have a look on my small project.
Hello Rioven,

I had a closer look on your application and 'played' a bit with it.

A few comments:
- From my point of view, as a user, I find it somewhat boring for the data input, for me there are too many mouse clicks needed.
- 1. select the cell
- 2. select textbox
- 3. enter data
- 4. click on check button to confirm

couldn't it be
- 1. select the cell, set directly focus on textbox
- 2. enter data
- 3. either
- click on another cell, and the data is confirmed
- click on check button to confirm
In this case if you enter a certain number of data you avoid 2 mouse clicks for each data.
Yes Klaus, I agree. I also found that somewhat inconvenience to the user. I've already tried what you have suggested, but I'm getting different behaviour on PPC, I have also implemented that user could click-select a variable on a cell that automatically write to textbox during input(similar to MSexcel) It works on desktop but getting errors on PPC. It became more complicated when I added the PPC arrows to navigate the cells. Maybe I need more time to get these right. Then I decided to go back on what it is now. I should give it a try again.

- Some cosmetics
- It could be intersting to save the table column widths when leaving the program, so the user will find the same configuration at the next start of the program.
This is also a good idea.

- The buttons on top, mainly on the desktop, are blurred, this is because the dimensions of the image buttons are different from those of the bitmaps so they are stretched.
Left buttons image buttons 20/20 bitmaps 21/21 pixels
Check button 20/20 bitmap 15/15
I'll correct these on my next update. Thanks so much.

As I saw your beam calculation example, are you making civil engineering calculations, it looks like a quite long alluminum beam ?
Similar that applies in basic calculation for building facade engineering for vertical member for wind load.

As I saw in your code some variable names, for example J%, this reminds me some 'older basic dialects' where the % suffix meant integer and the $ suffix string variables.
Oh yes, I didn't find time to change all of the variables, I've code this text evaluator subroutine long time ago in Qbasic(1993).

I haven't made many calculations, so from the functionnality and possibility points of view I have no other suggestions.

These comments are suggestions and just one point of view and for shure no critics at all.

Best regards

I've considered these as constructive comments, as I've known you who helps others to improve their creations.:sign0188:

Thank you and best regards,
 

Rioven

Active Member
Licensed User
Longtime User
update on CalcTable1.0

As Erel and Klaus commented, I have updated the following:

[The files were updated at the beginning of this thread]

-images were imbeded on exe.files
-less one mouse click during input, mouse click on table will focus the textbox and cursor to end of content.
-image buttons were improved(not stretched).
-fixed bugs on condition input(sample2.ct1 also adjusted)
-improved handling of exiting the application.

Please try again, and let me know. Any other comments are welcome
Thank you very much.:)
 

klaus

Expert
Licensed User
Longtime User
Hi Rioven,

At last I have taken time to look at you updated version. I was abroad during 10 days and during the last days I did some other stuff.

In trying it, I many times forgot to click on the check button, probabIy Excel habits. I added one line in the TextBox1_LostFocus routine that valdates the entry directly when clicking on another cell in the table.

B4X:
Sub textbox1_lostfocus
  If srow<>-1 AND scol<>-1 AND Control("col"&Scol,arraylist).count<>0 Then 'only functions on Desktop
'    Control("col"&Scol,arraylist).item(Srow)=textbox1.Text
'    table1.Cell(table1.ColName(Scol),Srow)=textbox1.Text
    imgm.Visible=false
    imgn.Visible=false   
  End If
  [COLOR="Red"]CheckT1_Click[/COLOR]
  Sip=false
End Sub

What is he hidden TextBox2 for ? I suspect that it is to get the LostFocus and Focus for TextBox1 work properly.

On top for the filename, I would display only the filename without the path, with long pathnames the field could become too short.
Perhaps another thought, replace the label for the filename by a ComboBox, if the user makes related calculations with different files, he could add the filenames in the ComboBox and then get a quicker access to load them.

For me, to make reading easier, I prefer having upper case characters in long names, like FixTableWidth instead of fixtablewidth. But this is one cosmetic opinion.

I have joined the updated version.

Good job !

Best regards.
 

Rioven

Active Member
Licensed User
Longtime User
CalcTable1.2desktop

Hi Klaus,
I thank you again for your time.
The problem I have is that particular sub 'textbox1_lostfocus', it works only on desktop. As you can see on my [remarks] on that sub. This is why I have created the hidden textbox2 to make it worked on device. I don't know what are better solutions.
I have taken your additional code line and for desktop inputing could be lot easier using one of door library features that you could type directly on cells.

I agree on your suggestions and probably implemented on my future updates.

I have attached the CalcTable1.2desktop version for easier coding of formula on desktop also another sample conversion I've put together.

Thank you and best regards,
 

Attachments

  • conversion01.zip
    1.2 KB · Views: 220
Last edited:

Rioven

Active Member
Licensed User
Longtime User
CalcTable1.2

The Application have been updated and uploaded on the first post of this thread.

CalcTable1.2
-Added LOG( ) and SQRT( ) functions-by Klaus
-Altered ^ function on negation (sample: -2^2=-4 , (-2)^2=4 )-by Klaus
-Is now VGA compatible.
-fixed bugs on error messages.

Thanks to Klaus on some of the above contributions. :)

Best Regards,
 
Last edited:
Top