General information
Title:
FPW 2.6 to VFP8.0 syntax
HI,
Can someone helps me to translate FPW to VFP codes as suggestions for
the following procedures :
Tia
*=================================================
procedure V_SENDTO
*** Validation for laSENDTO list box
private lnREPLY, lcROUTER, lcSENDTO, lcDESTID, lcOPTIONS
if !glEDITABLE
*** Can't change it
return .t.
endif
if not between(lnSENDTO, 1, alen(laSENDTO,1)) ;
or empty(laSENDTO[lnSENDTO,1])
*** Nothing pointed to
return .t.
endif
*** Ask user what to do
if gcLANG = "E"
lnREPLY = alert("Delete or modify this destinee?", 0, ;
"\!\else
lnREPLY = alert("Supprimer ou modifier ce destinataire ?", 0, ;
"\!\endif
do case
case lnREPLY = 1
*** Modify
*-- Extract combined info line from laSENDTO
lcSENDTO = laSENDTO[lnSENDTO, 2]
*-- Extract driver
lcROUTER = trim(left(lcSENDTO, 5))
lcSENDTO = substr(lcSENDTO,6)
*-- Extract destinee (expression)
lnAT = at(chr(0), lcSENDTO)
if lnAT = 0
*** This shouldn't happen
return
endif
lcDESTID = left(lcSENDTO, lnAT-1)
*-- Extract options
lcOPTIONS = substr(lcSENDTO, lnAT+1)
*** Call driver to modify the destinee(s)
do ("SND" + lcROUTER) with "CHOOSEDEST", lcOPTIONS, lcDESTID
*** Put results back into laSENDTO array
laSENDTO[lnSENDTO,2] = ;
padr(lcROUTER,5) + lcDESTID + chr(0) + lcOPTIONS
do MakeCol1 with lnSENDTO
case lnREPLY = 2
*** Delete the line
if alen(laSENDTO,1) = 1
laSENDTO = ""
else
= adel(laSENDTO, lnSENDTO)
dimension laSENDTO[alen(laSENDTO,1)-1, 2]
endif
case lnREPLY = 3
return
endcase
show get lnSENDTO
return
*=================================================
procedure MakeCol1
*** Creates Column 1 of laSENDTO from column 2.
parameter lnROW
if empty(laSENDTO[lnROW,2])
laSENDTO[lnROW,1] = ""
else
laSENDTO[lnROW,1] = ;
proper(trim(left(laSENDTO[lnROW,2], 5))) + ": " + ;
leftto(substr(laSENDTO[lnROW,2], 6), chr(0))
endif
return
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