Simplicty and flexibility!


Retval := SetVar ... results in dataease fatal exception


Started by Simon B
Search
You will need to Sign In to be able to add or comment on the forum!

Retval := SetVar ... results in dataease fatal exception

During month end I have to run numerous reports.  At present I do it a rather long winded way as they are all DQL reports.  so I have a DQL that does this but it's repetitive as I have to enter a date range for each DQL report.  So I'm now converting DQL's to QBM's, and wrote a single DQL to seed and hold the date range.

Running one of my new QBM's off an execute button, with a seeding DQL; pce_REPORT_CRITERIA , works great:

SetVar("report_type","qaa DELIVERY NOTE") + OpenProcedure("pce_REPORT_CRITERIA" ) .

Now I know this works I want to run the above QBM (and seeding DQL) from a DQL, the plan being I can call multiple QBM's using the DQKL to seed the date range.  In it's simplest form and with just ONE QBM, my DQL is:

Define "Retval" text .
for fad ADMIN ;
Retval := SetVar("report_type","qaa DELIVERY NOTE") .
run procedure "pce_REPORT_CRITERIA" .
end

The above causes Datease 8.2 to crash with an exception report every time.  Why?

During debugging I Removed the line:

Retval := SetVar("report_type","qaa DELIVERY NOTE") and ran again (manually choosing qaa DELIVERY NOTE).  This works without crashing.  Any idea why what should be simple crashes dataease 8.2 ?    Defining RetVal as a number incidently makde no difference.


For reference the seeding DQL pce_REPORT_CRITERIA is:

-- table 'fad ADMIN'.  Table fields invr1 to invr6 hold the name of the QBM's i want to run.

define "t" number .
t := setvar ( "DateFrom" , data-entry datea ) .
t := setvar ( "DateTo" , data-entry dateb) .
t := setvar ( "De_area" , data-entry area) .
t := setvar ( "De_manualheading" , data-entry manualheading) .
t:= documentopen (GetVar("report_type")) .


Written by Simon B 14/04/15 at 14:09:27 Dataease [{8}]FIVE

Re:Retval := SetVar ... results in dataease fatal exception

Note:

Fad ADMIN table whas 1 record. Iv'e also tried putting

run procedure "pce_REPORT_CRITERIA" .

outside the for loop, no difference.


The reason I have a for loop is because the table 

Fad ADMIN

holds the names of all the qbm reports to run at month end.  In the DQL shown I've simplied it by entering the DQL directly (qaa DELIVERY NOTE).


Written by Simon B 14/04/15 at 15:09:02 Dataease [{8}]FIVE

Re:Re:Retval := SetVar ... results in dataease fatal exception

We use Setvar()/GetVar() extensively and have never had any problems with them.

This is the kind of Yeti problem that we can't really address without a sample app the showcase the problem.


Written by DataEase 16/04/15 at 15:05:35 Dataease [{8}]FIVE
DG3_ForumList