** Get transfer definitions for a dynamic menu. LOCAL lnRecs, i, j LOCAL lcBarMsg, lcCxfer, lcClFile, lcCrFile, lcCros LOCAL lnlenCxfer, lcSelected, lcPopUpName LOCAL x LOCAL laTansdef[1] DECLARE laTansdef[1,4] SELECT DISTINCT ; cxfer , ; clfile ,; crfile ,; cros , ; cmduser ; FROM transfer ; WHERE !DELETED() ; AND cmduser = ; gcUserId ; ORDER BY cxfer ; INTO ARRAY laTansdef lnRecs = ALEN(laTansdef)/4 - 1 IF lnRecs = 0 =msgfrm('There are NO Transfer Definitions to add' + ; CHR(10) + SPACE(5) + 'to the Transfer Definitions nenu' ; ,'0',,'S','No Transfer Definitions',0,gnMsgWait) RETURN .F. ENDIF lcPopUpName = 'Definitions' DEFINE MENU TransferDefs FONT "Arial", 11 STYLE "I" DEFINE PAD TransferDefs OF TransferDefs PROMPT "Transfer Definitions" DEFINE POPUP &lcPopUpName FONT "Arial", 11 SHORTCUT ON PAD TransferDefs OF TransferDefs ACTIVATE POPUP &lcPopUpName FOR i = 1 to lnrecs lcCxfer = ALLTRIM(laTansdef[i,1]) lnlenCxfer = LEN(lcCxfer) lcClFile = ALLTRIM(laTansdef[i,2]) lcCrFile = ALLTRIM(laTansdef[i,3]) lcCros = ALLTRIM(laTansdef[i,4]) DO CASE CASE !EMPTY(lcClFile) AND !EMPTY(lcCrFile) lcBarMsg = lcCxfer + " - Copy locate file " + lcClFile + ; " to remote file " + ; lcCrFile+ " on " + lcCros CASE !EMPTY(lcClFile) AND EMPTY(lcCrFile) lcBarMsg = lcCxfer + " - Copy locate file " + lcClFile + ; "Prompt for remote file on " + lcCros CASE EMPTY(lcClFile) AND !EMPTY(lcCrFile) lcBarMsg = lcCxfer + " - Prompt for local file " + "and copy to remote " + ; lcCrFile + " on " + lcCros CASE EMPTY(lcClFile) AND EMPTY(lcCrFile) lcBarMsg = lcCxfer + " - Prompt for local and remoter files and copy to " + lcCros OTHERWISE *!* nop ENDCASE DEFINE BAR i OF &lcPopUpName PROMPT lcBarMsg ON SELECTION BAR i OF &lcPopUpName DO doftp WITH i , lcCxfer ENDFOR ACTIVATE MENU TransferDefsMy proplem is with the line
ON SELECTION BAR i OF &lcPopUpName DO doftp WITH i , lcCxferCurrently all the doftp program does is display what it thinks i and lcCxfer are. The problem it displays the last value "lcCxfer = TESTEB" and i = 5. But there ar only 4 menu itesm.