Ayuda con Arrays TestData[nI,4] = desig->nmes

Ayuda con Arrays TestData[nI,4] = desig->nmes

Postby devwin2004 » Wed Dec 28, 2005 11:40 pm

Estimado Colegas


Necesito extraer un dato de array = a un campo de una dbf y pasarselo a
un action de un boton si alguien me puede echar una mano

desde ya muchisimas gracias
Dante
devwin2004@yahoo.com.ar


EJ
TestData[nI,4] = desig->nmes

adjunto codigo fuente





use desig
TestData := Array( lastrec(), 4 )


FOR nI := 1 TO Len(TestData)
TestData[nI,1] = val(desig->dntop)
TestData[nI,2] = val(desig->dnleft) //CANT
TestData[nI,3] = desig->dbmp
TestData[nI,4] = desig->nmes



@ TestData[nI,1],TestData[nI,2] sbutton TestData[nI,3] FILENAME

"MESA8C.bmp" PROMPT TestData[nI,3] size 64,64 OF oDlg pixel TEXT

ON_BOTTOM NO BOX Action (TestData[nI,3])


IF .NOT.EOF()
SKIP
ENDIF
NEXT


return nil
devwin2004
 
Posts: 42
Joined: Mon Dec 05, 2005 1:27 am

Postby Antonio Linares » Thu Dec 29, 2005 8:49 am

Por favor, genera el PPO resultante y copia aquí el resultado de:

@ TestData[nI,1],TestData[nI,2] sbutton TestData[nI,3] FILENAME

"MESA8C.bmp" PROMPT TestData[nI,3] size 64,64 OF oDlg pixel TEXT

ON_BOTTOM NO BOX Action (TestData[nI,3])
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby devwin2004 » Thu Dec 29, 2005 1:03 pm

Antonio te envio el PPO


Gracias
Dante
devwin2004@yahoo.com.ar


#include "FiveWin.ch"
#include "Tsbutton.ch"


//----------------------------------------------------------------------------//





function Main()

local obmp,testdata,nI,cget,mg2,b,nkey,aFont,oFont,Afont1,xbmp[14],xnmesa[14],ntop,nleft
locaL XX1
local xmesa:= 0
local nStyle := nOr( WS_POPUP, ; // System menu de oDlg
WS_MAXIMIZE ) // botón maximize habilitado y botón minimize deshabilitado







DEFINE FONT aFont NAME "Arial" SIZE 0, -14 BOLD ITALIC
DEFINE FONT oFont NAME "Arial Black" SIZE 0,-18
DEFINE FONT aFont1 NAME "Arial" SIZE 0, -12 BOLD ITALIC


DEFINE WINDOW oDlg TITLE "Database LAB" COLOR "N/G" && OF oWnd MDICHILD && NOSYSMENU TION NOMAXIMIZE NOICONIZE



sele 8
use desig
TestData := Array( lastrec(), 4 )


FOR nI := 1 TO Len(TestData)
TestData[nI,1] = val(desig->dntop)
TestData[nI,2] = val(desig->dnleft) //CANT
TestData[nI,3] = desig->dbmp
TestData[nI,4] = desig->nmesa



@ TestData[nI,1],TestData[nI,2] sbutton TestData[nI,3] FILENAME "MESA8C.bmp" PROMPT TestData[nI,3] size 64,64 OF oDlg pixel TEXT ON_BOTTOM NO BOX

IF .NOT.EOF()
SKIP
ENDIF
NEXT



ACTIVATE WINDOW oDlg maximized

return nil







devwin2004
 
Posts: 42
Joined: Mon Dec 05, 2005 1:27 am

Postby devwin2004 » Thu Dec 29, 2005 1:06 pm

Antonio

Te lo envio perdon por el error


gracias
Dante
devwin2004@yahoo.com.ar


function Main()

local obmp,testdata,nI,cget,mg2,b,nkey,aFont,oFont,Afont1,xbmp[14],xnmesa[14],ntop,nleft
locaL XX1
local nStyle := nOr( 2147483648, 16777216 )

aFont := TFont():New( "Arial", 0, -14,,.T.,,,,.T.,,,,,,,, )
oFont := TFont():New( "Arial Black", 0, -18,,,,,,,,,,,,,, )
aFont1 := TFont():New( "Arial", 0, -12,,.T.,,,,.T.,,,,,,,, )


oDlg := TWindow():New(,,,, "Database LAB",,,,,,,, "N/G",,,, !.F., !.F., !.F., !.F., .F. )


dbSelectArea( "8" )
dbUseArea( .F.,, "desig",, if(.F. .OR. .F., !.F., NIL), .F. )
TestData := Array( lastrec(), 4 )


FOR nI := 1 TO Len(TestData)
TestData[nI,1] = val(desig->dntop)
TestData[nI,2] = val(desig->dnleft)
TestData[nI,3] = desig->dbmp
TestData[nI,4] = desig->nmesa


TestData[nI,3] := NO := BOX := TSButton():New( TestData[nI,1], TestData[nI,2],TestData[nI,3],oDlg,,{"MESA8C.bmp"},{64,64},.T.,,,,,,,,,,,,,3,,,, )

IF !EOF()
dbSkip(1)
ENDIF
NEXT



oDlg:Activate( Upper("maximized"), oDlg:bLClicked, oDlg:bRClicked, oDlg:bMoved, oDlg:bResized, oDlg:bPainted, oDlg:bKeyDown, oDlg:bInit,,,,,,,,,,, oDlg:bLButtonUp )

return nil

devwin2004
 
Posts: 42
Joined: Mon Dec 05, 2005 1:27 am


Return to FiveWin para CA-Clipper

Who is online

Users browsing this forum: No registered users and 7 guests