General information
Category:
Coding, syntax & commands
Randy,
Thank you for such a great contribution. The following is part of my procedure which converts a table with memo fields to an Excel file. This procedure works OK if I run it from VFP command window, but it produces a "Function name is missing ) while processing line if mlen < meml(eval(&memofld))" error if I run it through codeblock. Is my procedure violating any of the rules you set for the codeblock?
close data all
use vntr
mmemo=set('memo')
set memo to 95
copy stru to temp
use temp excl in 3
sele temp
store '' to memo1, memo2, memo3, memo4
j=0
for i=1 to fcount()
if type(field(i))='M'
j=j+1
mfield=field(i)
alter table temp alter &mfield C(100)
memofld='memo'+trans(j)
&memofld=field(i)
endif
endfor
sele vntr
go top
scan while !eof()
scat memvar
sele temp
appe blank
gather memvar
sele vntr
mlen=1
i=1
for i=1 to j
memofld='memo'+trans(i)
if mlen < meml(eval(&memofld))
mlen = meml(eval(&memofld))
endif
endfor
sele temp
i=1
for i=1 to mlen
if i>1
appe blank
endif
for k=1 to j
sele vntr
memofld='memo'+trans(k)
ms=strt(mlin(eval(&memofld),i),chr(9),' ')
sele temp
repl (&memofld) with ms
endfor
endfor
endscan
sele temp
copy to (juststem(mdbf)+'.XLS') xl5
set memo to mmemo
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