Thanks Richard, i was simultaneously writing a less elegant program. This program creates a program file that is hard-coded of course you can change this into a function and pass the database name to it.
Clear Set Printer To re_debt.prg Set Printer On ? 'use debt exclusive ' ? 'delete tag all ' ? ? ? Use debt Shared =Ataginfo(mike) For x=1 To Tagcount() If !Empty(mike(x,4)) ? 'index on '+mike(x,3)+ ' tag '+ mike(x,1)+ ' for ' + mike(x,4)+' '+mike(x,5) Else ? 'index on '+mike(x,3)+ ' tag '+ mike(x,1)+ ' '+mike(x,5) Endif Endfor Set Printer Off Set Printer To ________________________________ From: Richard Kaye <[email protected]> To: "[email protected]" <[email protected]> Sent: Monday, September 24, 2012 6:06 PM Subject: RE: is there a program to create program to build index from a cdx? This should get you started once you get past whatever wrapping Outlook does to my beautified code... :-) YMMV It's what I use for a somewhat generic reindex utility form. Replace the macro expansion with something that builds a string. LOCAL m.lcTable AS Character, m.lnCount AS Integer, m.lcFor AS Character, m.lcOrder AS Character, m.lcCollate AS Character LOCAL m.lcType AS Character, m.lcTagName AS Integer, m.lcKeyExpression AS Character m.lcTable=ALIAS() DIMENSION laIndexes[1] m.lnCount=ATAGINFO(laIndexes) IF m.lnCount>0 && we have tag info DELETE TAG ALL SET TALK WINDOW SET TALK ON FOR m.lnI=1 TO m.lnCount m.lcTagName=ALLTRIM(m.laIndexes[m.lnI,1]) m.lcType=ALLTRIM(m.laIndexes[m.lnI,2]) m.lcKeyExpression=ALLTRIM(m.laIndexes[m.lnI,3]) IF NOT EMPTY(m.laIndexes[m.lnI,4]) && index has a FOR clause m.lcFor=[ FOR ]+ALLTRIM(m.laIndexes[m.lnI,4]) ELSE m.lcFor=[] ENDIF m.lcOrder=ALLTRIM(m.laIndexes[m.lnI,5]) m.lcCollate=[ COLLATE ']+ALLTRIM(m.laIndexes[m.lnI,6])+[' ] IF m.lcType=[PRIMARY] TEXT TO m.lcIndexCommand TEXTMERGE NOSHOW FLAGS 1 PRETEXT 1+2+4+8 ALTER TABLE <<m.lcTable>> ADD PRIMARY KEY <<m.lcKeyExpression>> TAG <<m.lcTagName>> ENDTEXT ELSE TEXT TO m.lcIndexCommand TEXTMERGE NOSHOW FLAGS 1 PRETEXT 1+2+4+8 INDEX ON <<m.lcKeyExpression>> TAG <<m.lcTagName>> <<m.lcCollate>> <<m.lcFor>> <<m.lcOrder>> <<IIF(m.lcType<>[REGULAR],m.lcType,[])>> ENDTEXT ENDIF &lcIndexCommand NEXT ENDIF SET TALK OFF WAIT CLEAR -- rk -----Original Message----- From: ProfoxTech [mailto:[email protected]] On Behalf Of Michael Madigan Sent: Monday, September 24, 2012 5:10 PM To: [email protected] Subject: Re: is there a program to create program to build index from a cdx? Kind of. I'd rather create a hardcoded prg from the cdx The program examples ive seen so far don't handle ASCENDING, DESCENDIng, UNIQUE or FILTER ON _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/DF1EEF11E586A64FB54A97F22A8BD04421726A9A81@ACKBWDDQH1.artfact.local ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious. --- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html --- _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
