Page 1 of 1
PRINTING OF A SUBSET RECORDS CREATED BY DC_SETSCOPEARRAY
Posted: Fri Sep 28, 2012 6:29 am
by pauldewet
Hi Roger
I use DCBROWSE to view subsets of records created by using dc_setscopearray(). Is it possible to print those records? I haven't been able to limit the printing to the subset only. It would appear that DCPRINT doesn't respect the scope as the dc_db functions do.
Am I correct?
Any suggestions to solve the problem?
Paul
Re: PRINTING OF A SUBSET RECORDS CREATED BY DC_SETSCOPEARRAY
Posted: Fri Sep 28, 2012 6:50 am
by rdonnay
Paul -
This is not an issue related to DCPRINT. It is all about moving the record pointer.
You are probably using SKIP or dbSkip(), GO TOP or dbGoTop(), etc.
These are Xbase++ native functions and they know nothing about the scoping array.
This is why eXpress++ includes its own set of navigation functions that are wrappers to the native set of navigation functions.
You should use DC_DbSkip(), DC_DbGoTop(), DC_DbGoBottom(), DC_Eof(), etc.
BTW - If you ALWAYS use these functions in your code as replacements for the native functions, everything will work correctly.
If you prefer commands to functions you can add the following to one of your .CH files:
#command SKIP [<nRecords>] => DC_DbSkip([<nRecords>])
#command GO TOP => DC_DbGoTop()
#command GO BOTTOM => DC_DbGoBottom()
Roger
Code: Select all
USE \exp19\data\xtest
aRecords := {}
AAdd(aRecords, 200)
AAdd(aRecords, 300)
AAdd(aRecords, 400)
AAdd(aRecords, 500)
XTEST->(DC_SetScopeArray(aRecords)
XTEST->(DC_DbGoTop())
DO WHILE !XTEST->(DC_Eof())
? XTEST->city
XTEST->(DC_DbSkip())
ENDDO
XTEST->(DC_SetScopeArrray(nil))
Re: PRINTING OF A SUBSET RECORDS CREATED BY DC_SETSCOPEARRAY
Posted: Fri Sep 28, 2012 9:26 am
by c-tec
Hello,
I use for example FRAX reports and dc_scopearray() for reports, works perfect if you use the eXPress++ skip functions
regards
Rudolf
Re: PRINTING OF A SUBSET RECORDS CREATED BY DC_SETSCOPEARRAY
Posted: Sun Sep 30, 2012 11:33 pm
by pauldewet
Thanks Roger, you solved my problem!
Regards
Paul.