Scriptcase has become useless

Ok, I know new updates are hard. but this is ridiculous!!:

ok now check this code in onValidate:

executed with debug on:

The conditional doesnt accept that $cantidad is 0 obviously it continue to onSuccess.
$cantidad is 0

I’m wondering why you have shared so many negative comments yet many of us are building tools without problems!

Some time ago I was like you Muthaka, just from time to time reading negative messages in the forum or groups, but I was thinking yes I have some problems but I can solve it, I can make it works!!, but this time was my turn , my customers are angry with me because I lost like 4 projects I had to reedo all of them , those projects had backup but didnt work with the new version, why?, I dont know. and the problem with the themes, and with the images manager, and I realized why so many people before me were complaining, I am not a newbie on Scriptcase , I have 7 years using it and I think that without the bugs would be one of the best code generators, but enough is enough, I believe I am an average guy with more than 20 years using vb, c#,c++,android ,power apps,etc… so I think I can find a technical solution to my problems but when you are trying to do your homework and your own tool is draggin you down is time to rethink about it.

No, it’s your stuff that’s broken.

First off: you need to check whether the lookup succeeded or not.

$sql = "SELECT COUNT(*) FROM Whatever";
sc_lookup(res, $sql);
if( count({res}) == 0) {
    sc_error_message("There's a problem, please try later.");
    my_email("me@home","The db can't count records. Lol.");
} else if( {res} != false && !empty({res})) {
    {numwhatevs} = {res[0][0]};
} else {
    // Should never get here.
    {numwhatevs} = "0";
    my_email("me@home","It's all broken. AI won. Call mom & say goodbye.");
}

Always handle every possible outcome, even when you don’t think an outcome is possible.
Either there’s no result (!!), the result is valid, or it makes no sense: test for it & handle it anyway. Always. Seriously. Always.

Turning on SQL Errors or Debugging might help too.

The first image is the query executed on dbeaver, as you can see the result is zero ‘0’ , the if conditional checks if $cantidad is different to zero then echo “the result is not zero is $cantidad”; so there is a contradict each other.
You are checking counting the array items returned, I am checking the result of the query , I have 7 years doing like that but this is the first time it gives a weird result.