Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to edit Memo field
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01035419
Message ID:
01035488
Views:
15
Here is sample function that will keep things intact everytime you run it, without increasing the value of papersize.
CLOSE DATABASES ALL
lcFrx ="c:\program files\microsoft visual foxpro 9\samples\solution\reports\invoice.frx"
PAPERSIZE(lcFrx,121)

FUNCTION PAPERSIZE(lcFrx,nSize)
LOCAL lcNewExpr, lnStartCopiesLine, lcStartAtCopiesLine, lnEndCopiesLine,lnLenCopiesLine, lcTop, lcBottom
#DEFINE vfCRLF CHR(13) + CHR(10)

IF !(UPPER(RIGHT(lcFRX, 4)) = ".FRX")
    lcFRX = lcFRX + ".FRX"
ENDIF
USE (lcFRX)
LOCATE FOR objType = 1 AND objCode = 53

IF EMPTY(EXPR)

    lcNewExpr = "PAPERSIZE=" + ALLT(STR(nSize)) + vfCRLF
ELSE

    lnStartCopiesLine = ATC("PAPERSIZE", EXPR)
    lcStartAtCopiesLine = SUBSTR(EXPR, lnStartCopiesLine)
    lnEndCopiesLine = ATC(vfCRLF, lcStartAtCopiesLine)
    lnLenCopiesLine = LEN(SUBSTR(lcStartAtCopiesLine, 1, lnEndCopiesLine))
    lcTop = SUBSTR(EXPR, 1, lnStartCopiesLine - 1)
    lcBottom = SUBSTR(EXPR, (LEN(lcTop) + lnLenCopiesLine))
    lcNewExpr  = lcTop + "PAPERSIZE=" + ALLT(STR(nSize)) + lcBottom

ENDIF

REPLACE EXPR WITH lcNewExpr
USE IN (lcFRX)
ENDFUNC
>I found out after running many time, my memo becomes long & longer (PAPERSIZE=12121212), so I have to use all the functions you guys suggested.
>
>thanks for everything.
>
>regards,
>
>Jerry
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform