PDA

View Full Version : Calculated fields (form) problems ...


ABC123

peterg000
02-22-2007, 03:23 PM
I have some calculated fields that where working just fine from V6 to V7 and know in V8, they are not. Looks like some changes where made to screen that allows calculated values to be defined. There is this smart promting to explicitedly define "VAR->", or the "TABLE->", or "CALC->" ..... but this is not synching up with expression builder that allows for much more like using form object values. I went into expression builder and my expression works just fine ..... come out to calc value screen and it says it cant find field.

I attached screenshot of expression builder showing ok and calc screen saying no good.

Any help would be much appreciated ....

Glenn

Cian Chambliss
02-23-2007, 04:08 AM
I can reproduce the problem, and I am working on a fix.

interestingly, it seems to allow function calls - i.e.

customer_id_lbl.value

fails

customer_id_lbl.name()

works (though appears to return a blank string)

Also - eval doesn't appear to have a problem:

eval("customer_id.value","topparent.this")

except for the fact that it returns a blank.

The calculated field editor takes over the parsers handling of field tokens (so that new calculated fields that were just defined can be used) , so it probably is that case that there is an error in this code when it encounters something that looks like a field from the parser standpoint, but in fact is *not* a field (i.e. object properties are not treated as fields).

Cian Chambliss
02-23-2007, 04:43 AM
This has now fixed, and should be in the next patch.

peterg000
02-23-2007, 08:53 AM
Cian ..... Thanks!!! .... (i sent this in to alpha bug address as well)

The million dollar question ...... when do you think fix will be available .... this stops me in my tracks from upgrading my app from v7 to v8.

Thanks again in advance ....

Glenn

Cian Chambliss
02-23-2007, 09:04 AM
The V8 DLL that contains the is in the zip file attachment - it should work if overlaid on top of the latest patch beta (available at http://downloads.alphasoftware.com/a5v8download/betapatchdownload.htm).

After installing the patch, you must copy this file over the a5iutil.dll in the a5v8 executable path (making sure that alpha five is not running when you do this).

This change should be included in the subsequent patch, once I let selwyn know its been fixed.

peterg000
02-23-2007, 11:21 AM
Still issues with Calc fields .....

Cian .... thanks for the fix ..... got me past the use of object values in my calc field. Problem now is that is takes about 15-20 seconds to open calc value screen and every cursor movement through the calc field it tries to re-calc and takes yet another 20 seconds. This form came from V6 to V7 to now V8 ..... have not done alot of design in V7, but this exact calc scenario opens in a split second in V6 and does not give me any problems as i cursor through the name of the calc field. My screen shot show the calc field "owner_balance" and you should be able to see that im using extensive use of tablesum. Let me know if you cant re-produce and I will try to cut out of my application and send. Thanks!!

Glenn

peterg000
02-23-2007, 11:29 AM
Cian .... attached a screen shot which show the status bar having issues with re-calc as well .... gets up to 99% and the just stays displayed even though calc is done.

Cian Chambliss
02-23-2007, 01:24 PM
Hi Glenn,

The slowness you are experiencing has been fixed as well - a form whose calc fields load with errors - i.e. for instance when objects or fields named don't yet exists, would retry evaluation in v8 - this has been fixed so that if evaluation fails once during a bulk operation (i.e. load calc fields or enumerate calc fields) it doesn't keep re-evaluating code that already failed.

There was a thread covering this issue (slow form loading in v8 or something like that..) - This change took load time from 15 seconds to 0.5 seconds...

peterg000
02-23-2007, 01:46 PM
Cian,
I did see that thread, but didnt think it applied because it was dealing with validating invalid calc-fields. I downloaded the latest beta patch release and have applied the zip you sent me .... doesnt look like that fix is on this beta patch .... can you confirm?

Glenn

Cian Chambliss
02-23-2007, 02:43 PM
The slowness issue was was fixed around 4pm yesterday, the patch was built around 2pm, so the patch that was released doesn't have the calc-field-load-time fix in it.

peterg000
02-23-2007, 03:09 PM
Thanks Cian!!

peterg000
02-25-2007, 04:57 PM
Cian,
I put the latest (3057) beta patch on and even though it fixed valdation problem it hasnt fixed the problem of re-calcing as i move through the character positions of my calc field. The calc field in question is shown in the screenshot as "owner_balance" ..... when i cursor to begining of the line alpha re-calcs for about 20 seconds .... i move cursor over one character and it re-calcs again for 20 second ..... again and again until i get to where i need to get in the line. I could imagine if i had to work with multiple calc fields like this, I would pull out every hair in my head. This problem did not exist in V6 and hopefully you will be able to remedy. Please let me know if there is anything else I can provide you to help debug.

Thanks again .....

Glenn

Cian Chambliss
02-25-2007, 05:47 PM
Ok, I will take a look at this. I almost wonder if there is some recursion going on because the single-line calc field validation only visits the fields that are actually referenced.

Thanks,
Cian

Cian Chambliss
02-26-2007, 06:56 AM
Glenn,

Regarding the slowness of calculated field evaluation, can you please send me your application so that I can profile it, and find the bottleneck in validate?

Thanks,
Cian

peterg000
02-26-2007, 09:34 AM
Cian,
No problem, but to profile correctly you will need full data ..... I reduced app as much as I can, but with data the backup is still around 5M .....where can I send or ftp to?

Glenn

Cian Chambliss
02-26-2007, 09:40 AM
If the size of the zip is less than or around 4meg, an email attachment will work fine - my email address is

cian@alphasoftware.com

If it is much bigger than 4meg, I will ask lenny where the best place to upload to is (we have a ftp://mail@alphasoftware.com/incoming folder which I use for testing the FTP functionality, but that might not be the best place).

Thanks,
Cian

peterg000
02-26-2007, 10:33 AM
Cian,
Just sent zipped backup to your email. A little over 3M. Let me know if you have any issues.

Glenn

Cian Chambliss
02-26-2007, 11:47 AM
Hi Glenn,

I changed evaluation to use key-length calculation instead of doing an actual evaluation (because there was a summary expression, every keystroke forced a recalculate).

This will mean that the results (displayed under the calc field list) we get back will only be useful for determining type, but it will no longer be painful to edit an external summary equation.

Thanks,
Cian

peterg000
02-26-2007, 12:19 PM
Thanks Cian ...... next patch?

By the way, this worked in v6 and still showed result of calc-field without any problem or re-calc .... what changed in v8?

Glenn