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
Ayuda con Arrays TestData[nI,4] = desig->nmes
-
- Posts: 42
- Joined: Mon Dec 05, 2005 1:27 am
- Antonio Linares
- Site Admin
- Posts: 42409
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 12 times
- Been thanked: 48 times
- Contact:
-
- Posts: 42
- Joined: Mon Dec 05, 2005 1:27 am
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
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
-
- Posts: 42
- Joined: Mon Dec 05, 2005 1:27 am
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
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