Page 1 of 1

Tagging and DCTAGS Array

Posted: Sat Mar 17, 2012 6:56 am
by RDalzell
Hello Roger and All,

Using the record tagging example I am unable to determine how to process the array of RecNo() within DCTAGS.
I would like to obtain my index key from the database and process using this new array (aConsolidate).

As Always, I Appreciate any and all assistance.

DCTAGS Array:
{{"PARKMST", {100,201,305,414,575,603,717,890}}}

Code: Select all

x                  := 1
aConsolidate := {}
DO WHILE x <= Len(DcTags)
  SELECT ParkMst
   ParkMst->(DbGoTo(DcTags[1,x]))
   aConsolidate[x] := ParkMst->T_Number
   Aadd(aConsolidate, DcTags[1,x])
   x++
ENDDO

Re: Tagging and DCTAGS Array

Posted: Sat Mar 17, 2012 5:44 pm
by RDalzell
Thanks to all who took a peek,

Uncertain as to why, but this works...

Code: Select all

 
SELECT ParkMst
aRecNo  := DcTags[1,2]
aTicket := {}
FOR   i := 1 TO Len(aRecNo)
  nRecord := aRecNo[i]
  ParkMst->(DbGoTo(nRecord))
  Aadd(aTicket, ParkMst->T_Number)
NEXT

Re: Tagging and DCTAGS Array

Posted: Sun Mar 18, 2012 9:14 am
by skiman
RDalzell wrote: DCTAGS Array:
{{"PARKMST", {100,201,305,414,575,603,717,890}}}

len(dctags) is 1!!!

Code: Select all

x                  := 1
aConsolidate := {}
// DO WHILE x <= Len(DcTags)
// Should be
do while x <= len(dcTags[1][2]

  SELECT ParkMst
  // ParkMst->(DbGoTo(DcTags[1,x]))
  // should be
   ParkMst->(DbGoTo(DcTags[1,2,x]))
   aConsolidate[x] := ParkMst->T_Number
   // Aadd(aConsolidate, DcTags[1,2,x])
  // should be
   Aadd(aConsolidate, DcTags[1,2,x])
   x++
ENDDO
However, you have aConsolidate[x] := ParkMst->T_Number and afterwards you have Aadd(aConsolidate, DcTags[1,2,x]) ???

Anyway the structure of dcTags seems to be the problem.

Hope this helps.

Re: Tagging and DCTAGS Array

Posted: Sun Mar 18, 2012 11:10 am
by RDalzell
Thanks Chris,

Makes better sense now.

Rick

Re: Tagging and DCTAGS Array

Posted: Tue Mar 27, 2012 7:30 am
by rdonnay
Rick -

I would access the record tag array in a different way:

Code: Select all

aTags := ParkMst->(DC_RecTagArray())
Roger

Re: Tagging and DCTAGS Array

Posted: Sun Apr 08, 2012 7:18 pm
by RDalzell
Roger,

That makes it even easier.
I had originally looked at the docs, but your example here made it understandable.

Thanks