Page 1 of 1

DC_MergeGetLists()

Posted: Mon Jun 24, 2013 3:23 am
by unixkd
Hi Roger

In the program below, when I use @ ... DCSAY.. , the program execute without error, but when I use @ ... DCSAY ... GET the program gives error as indicated in the attachments.

#include "dcbitmap.ch"
#include "dcicon.ch"
#include "dcdialog.ch"
*
PROCEDURE Main()
Local GetList[0], Getoptions, cName := Space(40)
@ 1,1 DCSAY "My Name:" GET cName

GetList := PPS_Address(3,1,GetList)

DCGETOPTIONS NOMINBUTTON NOMAXBUTTON
DCREAD GUI OPTIONS GetOptions SETAPPWINDOW FIT MODAL ADDBUTTONS TITLE "Testing Merge Getlist"
Return
*
Function PPS_Address(nRow,nCol,aGetList)
Local GetList[0], aContactAddress[8], oGroup, aPrompt
aFill(aContactAddress, Space(50))
DEFAULT nRow := 1, nCol := 1
aPrompt := {"Street/Area","City/Town","State","Telephone Number", "E-Mail Address", "Fax Number", "Zip Code", "Web Site"}
@ nRow,nCol DCGROUP oGroup CAPTION "Contact Address" SIZE 62,10 FONT '12.Arial Bold'
nRow := 1
nCol := 15
For I := 1 To 8
@ nRow++,nCol DCSAY aPrompt+":" GET aContactAddress[1] ALIGNRIGHT RESIZE DCGUI_RESIZE_AUTORESIZE PROPER PARENT oGroup
// @ nRow++,nCol DCSAY aPrompt PARENT oGroup SAYSIZE 30 SAYFONT '10.Arial'
Next
aGetList := DC_MergeGetLists(aGetList, GetList )
Return(aGetList)
*
PROCEDURE APPSYS
RETURN

MergeGetlist1.png
MergeGetlist1.png (25.53 KiB) Viewed 8787 times
MergeGetlist2.png
MergeGetlist2.png (22.14 KiB) Viewed 8787 times

Re: DC_MergeGetLists()

Posted: Mon Jun 24, 2013 9:35 am
by rdonnay
DC_MergeGetLists() was not intended to be used for what you are trying to do.

This can be done much more simply.
Look at the below code.

Code: Select all

#include "dcbitmap.ch"
#include "dcicon.ch"
#include "dcdialog.ch"
*
PROCEDURE Main()
Local GetList[0], Getoptions, cName := Space(40)
@ 1,1 DCSAY "My Name:" GET cName

PPS_Address(3,1,GetList)

DCGETOPTIONS NOMINBUTTON NOMAXBUTTON

DCREAD GUI OPTIONS GetOptions SETAPPWINDOW FIT MODAL ADDBUTTONS ;
   TITLE "Testing Merge Getlist"

Return

* -------------

Function PPS_Address(nRow,nCol,GetList)

Local aContactAddress[8], oGroup, aPrompt

aFill(aContactAddress, Space(50))

DEFAULT nRow := 1, nCol := 1

aPrompt := {"Street/Area","City/Town","State","Telephone Number", "E-Mail Address", "Fax Number", "Zip Code", "Web Site"}
@ nRow,nCol DCGROUP oGroup CAPTION "Contact Address" SIZE 62,10 FONT '12.Arial Bold'
nRow := 1
nCol := 15

For I := 1 To 8
  @ nRow++,nCol DCSAY aPrompt[I]+":" GET aContactAddress[1] ;
   ALIGNRIGHT RESIZE DCGUI_RESIZE_AUTORESIZE PROPER PARENT oGroup
Next

RETURN nil


*
PROCEDURE APPSYS
RETURN

Re: DC_MergeGetLists()

Posted: Tue Jun 25, 2013 8:46 am
by hz_scotty

Code: Select all

For I := 1 To 8
  @ nRow++,nCol DCSAY aPrompt[I]+":" GET aContactAddress[1] ;
   ALIGNRIGHT RESIZE DCGUI_RESIZE_AUTORESIZE PROPER PARENT oGroup
Next
i think ;)

Code: Select all

@ nRow++,nCol DCSAY aPrompt[I]+":" GET aContactAddress[I] ;
aContactAddress

thats right - or?

Re: DC_MergeGetLists()

Posted: Tue Jun 25, 2013 9:16 am
by rdonnay
Yes, that was a typo. Should be I.