[FREE / Open Source] Max/Min Value of List - My First Extension

Introduction

Hi, today I am presenting you my very first published extension - MaxMinTools
This extension is simple, to get the minimum/maximum value of a list.

This is my first extension, so if there is any error please let me know

Blocks

blocks


Documentation:

Blocks Description
when Error occurred Raises when error occured (All errors can be view in Errors part)
call GetMaxValue Get maximum value of a list
call GetMinValue Get minimum value of a list
call GetValue Get maximum/minimum value. To get max value, method should be 1, otherwise 0.
Maximum Return 1 for max method
Minimum Return 0 for min method

Errors reference

Error Code Error
0 Input method should either be 0 or 1
1 Input list should be a list
2 Input list cannot be empty
3 Exception error
4 Unknown error, output is empty

Download

Version 3 com.appybuilder.bryanli1211.MaxMinTools.aix (11.7 KB)

Older version

Version 2 com.appybuilder.bryanli1211.MaxMinTools.aix (11.7 KB)


Version 1 com.appybuilder.bryanli1211.MaxMinTools.aix (11.7 KB)

Or download from :github:Github:

Change Log

Version 3
  • Image resized to 16x16
  • Removed unnecessary code
Version 2
  • Return “error” instead of empty string when error occurred.
  • Code optimized, suggested by @Mohamed_Tamer

Special thanks

@Mohamed_Tamer, helped me A LOT

@yusufcihan

33 Likes

Really great job @WatermelonIce :partying_face: :ok_hand: :+1:

3 Likes

Nice one. It will decrease the amount of efforts we put in our apps. :wink:

3 Likes

So useful!! Great extension! :smiley:

3 Likes

Thanks for appreciation @Mohamed_Tamer and @golumaths100 and @JaviR3TicS :grin:

I know there is this function in one of the colin tree extension, but it uses double type, which has a limit.
And mine uses the BigDecimal, so theoretically it can be as much as the memory can handle.

5 Likes

Gr8 @WatermelonIce !

3 Likes

Nice @WatermelonIce :slightly_smiling_face:
The way you represented your first extension in a organised way in first post. It’s to be appreciated :clap:

New Dev. can learn from it how to write a first post :slightly_smiling_face:

4 Likes

Thank you so much! @Tekwizer @themaayur

2 Likes

Nice extension, Good start :star_struck::+1::+1:

2 Likes

Thanks @The_K_Studio :grinning:

Nice job. Did some tests.

Could you make it so that if the list contains characters like in the example instead of numbers the "do it message displays “expect numbers”. Now it is showing “empty-string” but that isn’t true. It gets a string but not the string it expects.

3 Likes

So you want to add function such that it can compare text too?

1 Like

If you could add that that would be great. But it would get the same function as the compare text block it think. What i meant was that i would not expect an empty string message. I would like to see a message that would state that i have to use numbers when using the extension.

3 Likes

Because I am using the when error occurred event, it is impossible for me to throw error :sweat_smile:

2 Likes

Maybe I will add a if nothing return, like the tinyDB if not found, but I don’t know how to koders think.

When i do this

And use the error block with a label i get a

For input string: “a”

message.

3 Likes

Btw, i think you need to change your extension’s icon.
See:
image


And don’t forget to make its size 16×16 :wink:
Also i have some other suggestions:
1- make the extension’s blocks returns an int and not String.So We can use it in another blocks that require its input to be int.
2- Make your try-catch block inside the else condition here.So it doesn’t execute except there isn’t any error:
image
3- As @Peter said make the extension return something when an error occurred and not an empty string.Its better to return 0 or -1 for example so it can work with my first suggestion ( returning an int ) :slightly_smiling_face:.

2 Likes

I can perfectly load my icon. But it is 48x48

But if the list contain decimal, this won’t work.

Will do, thanks!

Because this extension will return a number, user won’t know if it is the result, or an error.
Maybe I shall return like "null" or "error"

1 Like

Good Work !!! :clap:t2: :clap:t2: :clap:t2:

2 Likes

Version 2 with a few changes!

4 Likes