General information
Category:
Forms & Form designer
Thanks for giving me some hints! All the support i find on UI is most useful. The code I just finished and tested is to be used in a COM project where I use VFP to create a result table and another programmer is using Delphi for presentation. After selecting data from 3 tables and created a view on selected fields, the sequence for x-tab came out like this:
*-- Use selected codes in selected sequence or use all if none is selected
IF !EMPTY(.cAnalyse)
nElm=ParseToArray(.cAnalyse,@aListe)
ELSE
SELECT DISTINCT analyse FROM x INTO ARRAY aListe
nElm=ALEN(aListe)
ENDIF
*-- create table for x-tab
ctxt='create table '+.cLokalDir+'rapport free (;
paar c(4), jrnlnr c(5), prvnr c(3),;
rekv c(6),;
sted c(2),;
pdato d(8),;
materiale c(6)'
FOR i=1 TO nElm
ctxt=ctxt+',A'+aListe[i]+' C(5)'
NEXT
ctxt=ctxt+')'
&ctxt
Select x
Goto TOP
cLast='?'
Scan
Select rapport
If x.paar+x.jrnlnr+x.prvnr <> cLast
cLast=x.paar+x.jrnlnr+x.prvnr
Append blank
Replace paar with x.paar,;
jrnlnr with x.jrnlnr,;
prvnr with x.prvnr,;
rekv WITH x.rekv,;
pdato with x.pdato,;
materiale WITH x.materiale,;
sted WITH x.sted
Endif
anxx='A'+x.analyse
* Replace &anxx with x.svar
Replace (anxx) with x.svar
Select x
Endscan
CLOSE TABLES ALL
endwith
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only