**************************************************************
FUNCTION SET_PAGE
&& 自定義紙張, 2008.01.28
**************************************************************
PARAMETER lcPAPERNAME,lcPAPERLENGTH,lcPAPERWIDTH,lcRPT_FILE,lcRPT_PATH
PRIVATE xIN_SELE
&& ,PAPERNAME,PAPERLENGTH,PAPERWIDTH
xIN_SELE = SELECT()
PAPERNAME
= lcPAPERNAME
PAPERLENGTH = lcPAPERLENGTH
PAPERWIDTH
= lcPAPERWIDTH
SELECT 0
USE ALLT(lcRPT_PATH) + ALLT(lcRPT_FILE)
IF IS_WIN98()
REPL EXPR WITH ItemSet(EXPR,"PAPERSIZE",256)
ELSE
DECLARE INTEGER PaperCode IN mpAPP_PATH + "LdPrn.dll" STRING,STRING,INTEGER,INTEGER
revalue= PaperCode(PAPERNAME," ",PAPERWIDTH,PAPERLENGTH)
REPL EXPR WITH ItemSet(EXPR,"PAPERSIZE",revalue)
ENDIF
USE
SELECT (xIN_SELE)
RETURN
**************************************************************
Function ItemSet
&& 自定義紙張, 2008.01.28
**************************************************************
PARA tcStr,tcItemID,tnItemValue
IF tcItemID $ tcStr
np1 = AT(tcItemID,tcStr)
cSubStr = SUBS(tcStr,np1+LEN(tcItemID)+1,6)
cItemValue = SUBS(cSubStr,1,AT(CHR(10),cSubStr)-1)
cItem = tcItemID+"="+cItemValue
cNewItem = tcItemID+"="+LTRIM(STR(tnItemValue))
RETU STUFF(tcStr,AT(cItem,tcStr),LEN(cItem),cNewItem)
ELSE
RETU tcStr+tcItemID+"="+LTRIM(STR(tnItemValue))+CHR(10)+CHR(13)
ENDIF
**************************************************************
FUNCTION IS_WIN98
**************************************************************
IF SUBSTR(OS(), AT('.',OS())-1)<='4'
lRtn = .T.
ELSE
lRtn = .F.
ENDIF
RETURN lRtn