by Ehab Samir Aziz » Sat Nov 12, 2005 10:58 am
To the first reply :
*------------------
I tried your help about combo Boxes but I got that error message :
Argument error : ALLTRIM()
I do not find any alltrim in the whole program .
To the second reply :
*------------------
I could not find any /source/classes directory in my evaluation version ,So I could not practise any dbcombo programs .
#include "FiveWin.ch"
#include "e:\programs\clipper\fweval\include\combos.ch"
#include "dbcombo.ch"
//------------------------------------------------------------------------//
function Main()
local oDlg
local oGet
local dDay := Date()
local dnum := 0
local dnam := space(40)
local dpho := space(10)
Local oCombo:=CARGACOMBO( .f., "CUST",1,"cu_Name" )
select 1
use cust
DEFINE DIALOG oDlg TITLE "Phone Book" FROM 0, 0 TO 23, 79
@ 1, 2 SAY "Number:" OF oDlg
@ 1, 6 GET oGet VAR dnum OF oDlg SIZE 20, 12 PICT "9999"
@ 2, 2 SAY "Date:" OF oDlg
@ 2, 6 GET oGet VAR dDay OF oDlg SIZE 40, 12
@ 3, 2 SAY "Name:" OF oDlg
@ 3, 6 GET oGet VAR dNam OF oDlg SIZE 120, 12 pict "@!"
@ 4, 2 SAY "Phone #:" OF oDlg
@ 4, 6 GET oGet VAR dpho OF oDlg SIZE 70, 12
@ 7, 6 BUTTON "&End" OF oDlg SIZE 30, 12 ACTION oDlg:End()
@ 8, 18 COMBOBOX oCombo VAR oCombo ITEMS oCombo OF oDlg
ACTIVATE DIALOG oDlg
*ON CHANGE MsgInfo( cCombo )
*oGet:bGotFocus := { || oGet:SelectAll() }
return nil
//------------------------------------------------------------------------//
/*Local aRubro:=CARGACOMBO( .f., "RUBRO",2,"NOMBRE" )
REDEFINE COMBOBOX oRubro VAR cRubro ITEMS aRubro ID 111 OF oFld:aDialogs[1] */
Function CARGACOMBO(VACIO,XARCH, XORDEN, XCAMPO)
Local ORD_ACT, AREA_ACT := SELECT()
Local VECTOR:={}
select 1
use cust
DBSELECTAR(XARCH)
ORD_ACT = INDEXORD()
SET ORDER TO XORDEN
DBGOTOP()
IF VACIO
AADD(VECTOR,SPACE(LEN(EVAL(FIELDBLOCK(XCAMPO)))))
ENDIF
DO WHILE !(XARCH)->(EoF())
AADD(VECTOR,EVAL(FIELDBLOCK(XCAMPO)))
(XARCH)->(DbSkip())
ENDDO
SET ORDER TO ORD_ACT
SELECT(AREA_ACT)
RETURN VECTOR