Dataease 6.52

Announcements and Frequently Asked Questions about DataEase

Dataease 6.52

Postby tim noble » Tue Apr 17, 2012 11:18 am

Hi, I was wondering if anyone could explain why when I list a virtual field in a procedure I get an exception error and Dataease crashes.

I have listed the procedure below: -

define "t" text 5 .
define "t1" text 5 .
define "t2" text 5 .
define "t3" text 5 .
define "t4" text 7 .
define "t5" Number .


for STOCK_
with Description not = "*FREE*" and Main_Heading not = blank
;
t := if (cost = 0, "000",if (cost >= 1,floor(cost * 100),
if( cost < 0.1,
jointext("00",(floor(cost * 100))),jointext("0",(floor(cost * 100)))))).
t1 := if (RRP1 = 0, blank,if (RRP1 >= 1,floor(RRP1 * 100),
if( RRP1 < 0.1,
jointext("00",(floor(RRP1 * 100))),jointext("0",(floor(RRP1 * 100)))))).
t2 := if (RRP2 = 0, blank,if (RRP2 >= 1,floor(RRP2 * 100),
if( RRP2 < 0.1,
jointext("00",(floor(RRP2 * 100))),jointext("0",(floor(RRP2 * 100)))))).
t3 := if (RRP3 = 0, blank,if (RRP3 >= 1,floor(RRP3 * 100),
if( RRP3 < 0.1,
jointext("00",(floor(RRP3 * 100))),jointext("0",(floor(RRP3 * 100)))))).
t4 := if (No_Stk = 0 , blank,(No_Stk)) .
--t5 := No_Stk - No_BOS .
t5 := No_Stk - sum of Rstk_soi no_inv .
list records
Code ;
Description ;
No_Ctn ;
Min_qty ;
-- RRP1 ;
lastc(jointext (" ",t1),5) ;
-- RRP2 ;
lastc(jointext (" ",t2),5) ;
-- RRP3 ;
lastc(jointext (" ",t3),5) ;
-- 100 * Cost ;
lastc(jointext (" ",t),5) ;
-- 1 * No_Stk;
laStc(jointext(" ",t4),7) ;
--No_Stk - No_BOS ;
t5 ;
Bar_Code ; --added 01/08 for export
Clearance ; --""
lastc(jointext (" ",t3),5) ;
i_c_q ;
Main_Heading ;
Sub_Heading ;
Sample ;
Size ;
Range ;
Pos ;
BOX ;
Web_Clearence ;
Web_Des1 ;
Related_Prod1 ;
Related_Prod2 ;
Related_Prod3 ;
Related_Prod4 ;
Related_Prod5 ;
Related_Prod6 ;
Related_Prod7 ;
Related_Prod8 ;
Related_Prod9 ;
Related_Prod10 ;
Related_Prod11 ;
Related_Prod12 ;
Related_Prod13 ;
Related_Prod14 ;
Related_Prod15 ;
YMAL ;
YMAL2 ;
YMAL3 ;
YMAL4 ;
Top 20 ;
Recently Added ;
web_status .


export to "C:\fanatic\exports\stock.txt" .
Code~Des~No_Ctn~Min_qty~RRP1~RRP2~RRP3~Cost~No_Stk~No_Stk-No_Bos~bar_code~Clearance~Clearance_price~i_c_q~Main_Heading~Sub_Heading~sample~size~range~pos~BOX~Web_Clearence~Web_Des1~Related_Prod1~Related_Prod2~Related_Prod3~Related_Prod4~Related_Prod5~Related_Prod6~Related_Prod7~Related_Prod8~Related_Prod9~Related_Prod10~Related_Prod11~Related_Prod12~Related_Prod13~Related_Prod14~Related_Prod15~YMAL1~YMAL2~YMAL3~YMAL4~top 20~recently added~Web_Status
.items
@f[1,1,4]~@f[1,2,22]~@f[1,3,5]~@f[1,4,5]~@f[1,5,5]~@f[1,6,5]~@f[1,7,5]~@f[1,8,5]~@f[1,9,7]~@f[1,10,6]~@f[1,11,12]~@f[1,12,3]~@f[1,13,5]~@f[1,14]~@f[1,15]~@f[1,16]~@f[1,17]~@f[1,18]~@f[1,19]~@f[1,20]~@f[1,21]~@f[1,22]~@f[1,23]~@f[1,24]~@f[1,25]~@f[1,26]~@f[1,27]~@f[1,28]~@f[1,29]~@f[1,30]~@f[1,31]~@f[1,32]~@f[1,33]~@f[1,34]~@f[1,35]~@f[1,36]~@f[1,37]~@f[1,38]~@f[1,39]~@f[1,40]~@f[1,41]~@f[1,42]~@f[1,43]~@f[1,44]~@f[1,45]
.end

The virtual field is Web_Status which is derived in the stock_ form as: -

If(no_stk + No_bop > No_Bos, Yes, No)
tim noble
 
Posts: 9
Joined: Tue Feb 19, 2008 3:03 pm
Location: Bristol
Has thanked: 0 time
Been thanked: 0 time
 

Re: Dataease 6.52

Postby Graham Smith » Tue Apr 17, 2012 11:56 am

My guess would be that this is a virtual field that is dependent on other virtual fields. Quite possibly, virtual fields that sum up data from a subform or are dependent on other virtual fields.

Given the general nature of your query, you would probably be better writing all the data to a holder file and exporting that. It would certainly be cleaner that way. Get all of those firstc() and quintuple nested if's out of the export query.
Graham Smith
DataSmith, Delaware
"For every expert there is an equal and opposite expert.", Arthur C. Clarke (1917 - 2008)
"X-Clacks-Overhead: GNU Terry Pratchett"
User avatar
Graham Smith
 
Posts: 2501
Joined: Fri Sep 07, 2007 11:31 am
Location: Delaware, USA
Has thanked: 0 time
Been thanked: 1 time
 

Re: Dataease 6.52

Postby Phil Winkler » Tue Apr 17, 2012 11:59 am

Hi, Tim, so if you don't have Web_Status in the list records it works fine?

How about if you define a variable in the DQL and use the same formula as in the form? Does that GPF, too?

All the fields in the formula, are they also virtuals? Something is blowing the stack causing the gpf.
Phil Winkler
PLM Consulting, Inc.
pwinkler@plmconsulting.com
Phil Winkler
 
Posts: 889
Joined: Fri Sep 07, 2007 12:45 pm
Has thanked: 0 time
Been thanked: 0 time
 

Re: Dataease 6.52

Postby tim noble » Tue Apr 17, 2012 12:59 pm

Hi Phil,
Yes two of the fields in the formula are virtual fields, as Graham says they sum up data from a subform.

Regards

Tim
tim noble
 
Posts: 9
Joined: Tue Feb 19, 2008 3:03 pm
Location: Bristol
Has thanked: 0 time
Been thanked: 0 time
 

Re: Dataease 6.52

Postby Adrian Jones » Tue Apr 17, 2012 1:38 pm

My newsletter, almost two years ago:

http://archive.aweber.com/n10net/1sDgj/ ... taease.htm

You can sign up to get this regularly via my homepage:

http://www.n10net.com

and don't forget I hold an annual workshop in Bristol in November (as well as one in London next month).
User avatar
Adrian Jones
 
Posts: 2000
Joined: Tue Sep 11, 2007 2:38 pm
Location: Cornwall, UK
Has thanked: 5 times
Been thanked: 4 times
 
 

Return to DataEase FAQ

Who is online

Users browsing this forum: No registered users and 1 guest

cron