PRINTING OF A SUBSET RECORDS CREATED BY DC_SETSCOPEARRAY

This forum is for eXpress++ general support.
Post Reply
Message
Author
pauldewet
Posts: 6
Joined: Sun Mar 07, 2010 3:09 am

PRINTING OF A SUBSET RECORDS CREATED BY DC_SETSCOPEARRAY

#1 Post 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

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: PRINTING OF A SUBSET RECORDS CREATED BY DC_SETSCOPEARRAY

#2 Post 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))
The eXpress train is coming - and it has more cars.

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: PRINTING OF A SUBSET RECORDS CREATED BY DC_SETSCOPEARRAY

#3 Post 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
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

pauldewet
Posts: 6
Joined: Sun Mar 07, 2010 3:09 am

Re: PRINTING OF A SUBSET RECORDS CREATED BY DC_SETSCOPEARRAY

#4 Post by pauldewet »

Thanks Roger, you solved my problem!

Regards

Paul.

Post Reply