Página 1 de 1

with object

Publicado: Mar Nov 30, 2004 4:39 pm
por Francisco
Se puede anidar un with object dentro de otro with object ?
Atentamente : Francisco Sanchez GERENTE GRUPO ST

with object

Publicado: Mar Nov 30, 2004 5:28 pm
por ignacio
Francisco,
Si pero logicamente ':' siempre apunta al último WITH object.
Saludos
--
Ignacio Ortiz
www.xailer.com
"Francisco" <total@arrakis.es> escribió en el mensaje
news:41ac9442$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Se puede anidar un with object dentro de otro with object ?
>
> Atentamente : Francisco Sanchez GERENTE GRUPO ST
>
>

with object

Publicado: Mié Dic 01, 2004 12:50 am
por Rene Flores
Francisco:
> Se puede anidar un with object dentro de otro with object ?
Por su puesto, este es un fragmento de mi codigo Xailer:
METHOD ConfiguraControles(cNomArch) CLASS TForm1
LOCAL oDbfBrowse, cAlias, oStatBar, nAdsServerType := 0
LOCAL oReBar, aIndex := {"<Ninguno>"}, oCombo, oBarCombo
LOCAL nIndices := 1
/* determinamos tipo de servidor ADS */
nAdsServerType := AdsIsServerLoaded(cFilePath(cNomArch))
/* abrimos base de datos */
cAlias := CnwOpenDbf(cNomArch,1,.T.)
IF EMPTY(cAlias)
MsgStop("No fue posible abrir la base de datos")
ELSE
DO WHILE .T.
IF ! EMPTY((cAlias)->(OrdName(nIndices)))
AADD(aIndex,(cAlias)->(OrdName(nIndices)))
nIndices++
ELSE
EXIT
ENDIF
ENDDO
AADD(::aAlias,cAlias)
WITH OBJECT ::oFolder1
:ADDITEM(cFileName(cNomArch))
:nIndex := LEN(:aPages)
/* creamos el ReBar */
WITH OBJECT oReBar := TReBar():New(:aPages[LEN(:aPages)])
:nAlign := alTOP
:Create()
END WITH
WITH OBJECT oCombo := TCOMBOBOX():New(oRebar)
:SetItems(aIndex)
:Cargo := cAlias
:nWidth := 100
:nStyle := csDROPDOWNLIST
:OnChange := {|oSender, nIndex|
(oSender:Cargo)->(OrdSetFocus(oSender:aItems[nIndex])),;
oDbfBrowse:Refresh(),;

oStatBar:SetText(3,"Llave de í­ndice:
"+(oSender:Cargo)->(OrdKey(nIndex-1))),;

oStatBar:SetText(4,ALLTRIM(STR((cAlias)->(OrdKeyNo())))+" /
"+ALLTRIM(STR((cAlias)->(OrdKeyCount())))),;
oStatBar:UpdatePanels()}
:Create()
END WITH
WITH OBJECT oBarCombo := TReBarBand():New(oRebar)
:oControl := oCombo
:Create()
END WITH
/* el orden de creacion de los controles es muy importante */
WITH OBJECT oStatBar := TstatusBar():New(:aPages[LEN(:aPages)])
:Create()
:nClrPane := RGB(0,0,255)
:SetParts(4)
:SetText(1,cNomArch)
DO CASE
CASE nAdsServerType == 0
:SetText(2,"Sin Servidor ADS")
CASE nAdsServerType == 1
:SetText(2,"Servidor LOCAL")
CASE nAdsServerType == 2
:SetText(2,"Servidor REMOTO")
ENDCASE
:SetText(3,"Llave de í­ndice: Ninguna ")
:SetText(4,ALLTRIM(STR((cAlias)->(OrdKeyNo())))+" /
"+ALLTRIM(STR((cAlias)->(OrdKeyCount()))))
END WITH
>
> Atentamente : Francisco Sanchez GERENTE GRUPO ST
>
>