Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To Write Data of DBF file in Text File
Message
From
11/03/2013 15:47:06
 
 
To
11/03/2013 13:25:45
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01567961
Message ID:
01568021
Views:
48
Thanks Madam, It is working Fine Now.

Another small Problem i am not able to solve it since last 2-3 weeks, could you help on it please.
I am trying to use the empty white blank space of Post script file for this I have written some code.

Kinldy see the last Para of the following code, Page break command for PS is Given in Last para, My problem is that using the Page break command I am able to merge two pages if unoccoupiedrange(I)> occoupiedrange(I+1), however if there is still more space left after one page is accomodated i.e I mean to say that IF unoccoupiedrange(I)> occoupiedrange(I+1)+occoupiedrange(I+2)...and so.

How to write code for it.

Some alteration in last Para is required.
Please help
lcStr = filetostr('1021337392.ps')
lnPOS = At("%%Pages:",lcStr)
lcPageCount = alltrim(substr(lcStr, lnPOS, 12))
lnPageCount = VAL(STRTRAN(lcPageCount,'%%Pages:',''))

IF lnPageCount>2
DIMENSION occoupiedrange(lnPageCount)
DIMENSION unoccoupiedrange(lnPageCount)

Local lcFile, lcText
m.lcFile = [1021337392.ps]
Create Cursor Dummy (PS c(254), pos i,pageno n(2))
Append From (m.lcFile) Sdf

SCAN
IF Getwordnum(PS, Getwordcount(PS)) = [x] .OR. ;
Getwordnum(PS, Getwordcount(PS)) = [y] .OR. ;
Getwordnum(PS, Getwordcount(PS)) = [w]
m.lcText = Getwordnum(PS, Getwordcount(PS) - 1) && The second last word
IF Len(Chrtran(m.lcText, [1234567890], [])) = 0 && lcText contains only digits
Replace pos With Val(m.lcText)
Endif
ENDIF
ENDSCAN
   
FOR I= 1 TO lnPageCount
CURTEXT='%%Page: '+ALLTRIM(STR(I))+' '+ALLTRIM(STR(I))
NeXTTEXT='%%Page: '+ALLTRIM(STR(I+1))+" "+ALLTRIM(STR(I+1))
LOCATE FOR ALLTRIM(PS)=curtext
SCAN WHILE ALLTRIM(ps)<>nexttext OR EOF()=.T.
REPLACE pageno WITH I
ENDSCAN
SELECT MIN(Pos) FROM Dummy WHERE Pageno=I AND Pos>30 INTO ARRAY X
SELECT MAX(Pos) FROM Dummy WHERE Pageno=I INTO ARRAY Y
STORE Y-X+1 TO Occoupiedrange(I)
STORE (x-30) TO unoccoupiedrange(I)
ENDF                                                                                                                                                                                                                                                  


**** LAST PARA

FOR I=2 TO (lnPageCount-1)
IF unoccoupiedrange(I)> occoupiedrange(I+1)
NeXTTEXT='%%Page: '+ALLTRIM(STR(I+1))+" "+ALLTRIM(STR(I+1))
LOCATE FOR ps=NeXTTEXT
Skip-1 
Replace ps WITH NeXTTEXT
SKIP
Replace ps WITH '0 -72 6 mul translate'
I=I+1
ENDIF
ENDFOR
ENDIF
>>Thanks Sir,
>>I tried the following code and it is working fine.
>>
>>
>>SELECT Dummy
>>set textmerge to Myfile.ps
>>scan
>>\<< tRIM(pS) >>
>>endscan
>>set textmerge to
>>set textmerge off
>>
>>
>>
>>The code is Working fine and the file size is also small. Only one little problem. The First Line in the reprocessed output file is coming blank as compared to the original file Ps/text file where the PS code starts from the first line itself.
>>
>>kindly help
>>
>
>That's because you're using \ rather than \\. When you do textmerge with \, you get a return before the line. Try it this way:
>
>>
>SELECT Dummy
>set textmerge to Myfile.ps
>scan
>\\<< tRIM(pS) >>
>\
>endscan
>set textmerge to
>set textmerge off
>
>
>Tamar
Harsh
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform