GET AND PICTURE ERROR

GET AND PICTURE ERROR

Postby Silvio » Sun Jun 28, 2009 7:40 pm

WHY WHEN i INSERT THE PICTURE MAKE ERROR ?

@9.5,30.8 GET oT:oDat[32] VAR oT:aDat[32] OF oDlc SIZE 65,11 PICTURE "99,999,999.99"


Error description: Error BASE/1122 Argument error: TRANSFORM
Stack Calls
===========
Called from: => TRANSFORM(0)
Called from: LIB\TGET.PRG => TGET:NEW(186)
Called from: source\RIV220.prg => NEWPRENOTA(3712)
Called from: source\RIV220.prg => (b)MENU_AZIONI(1003)
Called from: .\source\classes\MENU.PRG => TMENU:ACTIVATE(0)
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: GET AND PICTURE ERROR

Postby James Bott » Mon Jun 29, 2009 1:01 pm

Try leaving off the SIZE--maybe SIZE and PICTURE are conflicting.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: GET AND PICTURE ERROR

Postby nageswaragunupudi » Mon Jun 29, 2009 1:06 pm

I suspect the value of oT:aDat[32] is nil.

Transform( nil, '999.99' ) generates the same runtime error.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: GET AND PICTURE ERROR

Postby Silvio » Tue Jun 30, 2009 8:38 am

James and Nas

if i use the resource dialog and make it with redefines command all picture on the dialog run ok
when i use the dialog make with @x,y no resource it nou run


oT:aDat[32] is not nil


because when open the dialog I load all the variables

oT:oDat[ 1]:Enable()
oT:oDat[ 1]:Refresh()
oT:lApp:=oT:lEnd:=oT:lFst:=oT:lNew:=.T.
(oDCot)->(DbSetOrder(1))
(oDCot)->(DbGoBottom())
oT:aDat[ 1]:=StrZero(Val((oDCot)->NumDoc)+1,5)
(oDCot)->(DbSetOrder(nInd))
(oDCot)->(DbGoTo(nRec))
oT:aDat[ 2]:=Date()
oT:aDat[ 3]:="Cliente"
oT:aDat[ 4]:=Space( 4)
oT:aDat[ 5]:=Space(50)
oT:aDat[ 6]:=Space(35)
oT:aDat[ 7]:=Space(35)
oT:aDat[ 8]:=0
oT:aDat[ 9]:=15
oT:aDat[10]:=0
oT:aDat[11]:=0
oT:aDat[12]:=Space(45)
oT:aDat[13]:=Space(45)
oT:aDat[14]:="A"
oT:aDat[15]:="[ Nuova ]"
oT:aDat[16]:=2
oT:aDat[17]:=2
oT:aDat[19]:="Euro"
oT:aDat[20]:= 0
oT:aDat[21]:=oBtn:Cargo[2] //NUMERO OMBRELLONE
oT:aDat[22]:=oBtn:Cargo[4] // NUMERO FILA
oT:aDat[23]:=oBtn:Cargo[3] // TIPO OMBRELLONE
oT:aDat[24]:=ctod(" / / ") // DATA INIZIO
oT:aDat[25]:=ctod(" / / ") // DATA FINE
oT:aDat[26]:=.F. // INTERA STAGIONE
oT:aDat[27]:=0
oT:aDat[32]:=0 //ACCONTO
oT:aDat[33]:=.F. //PAGATO
oT:cPic1:= "9999999.99"
oT:cPic2:= "9999999.99"
oT:cPic3:="9999,999.99"
oT:cPic4:="9999,999.99"
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: GET AND PICTURE ERROR

Postby Silvio » Tue Jun 30, 2009 8:40 am

>Try leaving off the SIZE--maybe SIZE and PICTURE are conflicting.

I try to erase the size and it not run the error is the same
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: GET AND PICTURE ERROR

Postby James Bott » Tue Jun 30, 2009 11:08 am

I suggest looking at the preprocessor output to see if it is not creating the correct syntax.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: GET AND PICTURE ERROR

Postby Silvio » Tue Jun 30, 2009 11:20 am

it compile and link exe file
when I open the exe it make error



@ 3,0.5 GET oT:oDat[ 1] VAR oT:aDat[ 1] SIZE 40,12 OF oDlc PICTURE "999999" VALID Val_Doc() WHEN oT:lNew

@9.5,30.8 GET oT:oDat[32] VAR oT:aDat[32] OF oDlc SIZE 65,11 PICTURE "99,999,999.99"


THIS IS THE PPO
oT:oDat[ 1] := TGet():New( 3, 0.5, { | u | If( PCount()==0, oT:aDat[ 1], oT:aDat[ 1]:= u ) }, oDlc, 40, 12, "999999", {|| Val_Doc()},,,, .F.,, .F.,, .F., {|| oT:lNew}, .F., .F.,, .F., .F., .F.,, .F.,,,, )

oT:oDat[32] := TGet():New( 9.5, 30.8, { | u | If( PCount()==0, oT:aDat[32], oT:aDat[32]:= u ) }, oDlc, 65, 11, "99,999,999.99",,,,, .F.,, .F.,, .F.,, .F., .F.,, .F., .F., .F.,, .F.,,,, )


INSTEAD OF

ON THE RESOURCE DIALOG

REDEFINE GET oT:oDat[ 1] VAR oT:aDat[ 1] ID 101 OF oDlc PICTURE "@K99999" VALID Val_Doc() WHEN oT:lNew run ok

REDEFINE GET oT:oDat[32] VAR oT:aDat[32] ID 127 OF oDlc PICTURE "99,999,999.99" run ok
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: GET AND PICTURE ERROR

Postby James Bott » Tue Jun 30, 2009 11:28 am

Silvio,

As I said, I suspect the preprocessor is not generating the proper syntax. Did you check it?

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: GET AND PICTURE ERROR

Postby James Bott » Tue Jun 30, 2009 11:44 am

Silvio,

OK, the preprossor seems to be working OK. This code compiles and runs without error.

James

Code: Select all  Expand view
#include "fivewin.ch"

function main()
  local oDlc, oDat, aDat:=0

   define dialog oDlc

   //@9.5,30.8 GET oT:oDat[32] VAR oT:aDat[32] OF oDlc SIZE 65,11 PICTURE "99,999,999.99"

   @1,1 GET oDat VAR aDat OF oDlc SIZE 65,11 PICTURE "99,999,999.99"

   activate dialog oDlc

return nil
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: GET AND PICTURE ERROR

Postby nageswaragunupudi » Tue Jun 30, 2009 1:41 pm

I again insist that, for whatever reason, the variable is evaluating to NIL.
TRANSFORM(0) error occurs only when NIL is used as first argument of TRANSFORM with picture clause.

Only part of the error log is published.
Code: Select all  Expand view
Error description: Error BASE/1122 Argument error: TRANSFORM
Stack Calls
===========
Called from: => TRANSFORM(0)
Called from: LIB\TGET.PRG => TGET:NEW(186)
Called from: source\RIV220.prg => NEWPRENOTA(3712)
Called from: source\RIV220.prg => (b)MENU_AZIONI(1003)
Called from: .\source\classes\MENU.PRG => TMENU:ACTIVATE(0)
 

Please see what is above Stack Calls in the error log. The lines above will be something like
Error description: Error BASE/1122 Argument error: TRANSFORM
Args:
[ 1] = U
[ 2] = C 9999


Please publish the error long in full and see
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: GET AND PICTURE ERROR

Postby Silvio » Wed Jul 01, 2009 3:51 pm

Nas, If the variable is nil how you instst again why when I use the resource dialog it not make error ?
in first I load a class when I load arrayfor the procedure

oT:=CA_210():New()
Code: Select all  Expand view
CLASS CA_210
   DATA lNew, lAdd, lEnd, lFst, lCap, lApp, lGpo
   DATA oDat, oPar, aPar, oBtn, aTot, aDat, cGpo
   DATA cPic1, cPic2, cPic3, cPic4
   METHOD New() CONSTRUCTOR
ENDCLASS

METHOD New() CLASS CA_210
   ::lNew:=.F.
   ::lAdd:=.F.
   ::lEnd:=.F.
   ::lFst:=.F.
   ::lCap:=.F.
   ::lApp:=.F.
   ::lGpo:=.F.
   ::cGpo:=""
   ::aDat:=Array(33)
   ::oDat:=Array(33)
   ::aPar:=Array(15)
   ::oPar:=Array(15)
   ::oBtn:=Array( 5)
   ::aTot:=Array( 7)
   ::cPic1:= "9999999.99"
   ::cPic2:= "9999999.99"
   ::cPic3:="9999,999.99"
   ::cPic4:="9999,999.99"
RETURN (Self)


then I open the dbf and open the dialog with

Code: Select all  Expand view
oDCot:=Apri_Dbf("Cotiza",.T.,.T.,aIdx)
   oT:=CA_210():New()
   cVar:=aIdx[1]
   (oDCot)->(OrdSetFocus(1))

 DEFINE DIALOG oDlc TITLE "Gestione Prenotazioni" ;
      FROM  10,  30 TO  59, 134



then I insert the gets
@ 3,0.5 GET oT:oDat[ 1] VAR oT:aDat[ 1] SIZE 40,12 OF oDlc VALID Val_Doc() WHEN oT:lNew

here the others get

then I activate the dialog
Code: Select all  Expand view
ACTIVATE DIALOG  oDlc  CENTER  ;
     ON INIT Carga_Datos(lNew,obtn)
return nil
 


the function Carga_Datos(lNew,obtn) load the data into variables
Code: Select all  Expand view
STAT FUNC Carga_Datos(lNew,oBtn)
   LOCAL nI, nImp, nInd:=(oDCot)->(IndexOrd())
   LOCAL nRec:=(oDCot)->(Recno())
   AFill(oT:aTot,0)
   IF lNew
      oT:oDat[ 1]:Enable()
      oT:oDat[ 1]:Refresh()
      oT:lApp:=oT:lEnd:=oT:lFst:=oT:lNew:=.T.
      (oDCot)->(DbSetOrder(1))
      (oDCot)->(DbGoBottom())
      oT:aDat[ 1]:=StrZero(Val((oDCot)->NumDoc)+1,5)
      (oDCot)->(DbSetOrder(nInd))
      (oDCot)->(DbGoTo(nRec))
      oT:aDat[ 2]:=Date()
      oT:aDat[ 3]:="Cliente"
      oT:aDat[ 4]:=Space( 4)
      oT:aDat[ 5]:=Space(50)
      oT:aDat[ 6]:=Space(35)
      oT:aDat[ 7]:=Space(35)
      oT:aDat[ 8]:=0
      oT:aDat[ 9]:=15
      oT:aDat[10]:=0
      oT:aDat[11]:=0
      oT:aDat[12]:=Space(45)
      oT:aDat[13]:=Space(45)
      oT:aDat[14]:="A"
      oT:aDat[15]:="[ Nuova ]"
      oT:aDat[16]:=2
      oT:aDat[17]:=2
      oT:aDat[19]:="Euro"
      oT:aDat[20]:= 0
      oT:aDat[21]:=oBtn:Cargo[2]  //NUMERO OMBRELLONE
      oT:aDat[22]:=oBtn:Cargo[4]  // NUMERO FILA
      oT:aDat[23]:=oBtn:Cargo[3]  // TIPO OMBRELLONE
     * oT:aDat[24]:=ctod("  /  /  ")  // DATA INIZIO
     * oT:aDat[25]:=ctod("  /  /  ") // DATA FINE
       oT:aDat[24]:=date()  // DATA INIZIO
      oT:aDat[25]:=date() // DATA FINE



      oT:aDat[26]:=.F.               // INTERA STAGIONE
      oT:aDat[27]:=0

      oT:aDat[32]:=0        //ACCONTO
      oT:aDat[33]:=.F.     //PAGATO

      oT:cPic1:= "9999999.99"
      oT:cPic2:= "9999999.99"
      oT:cPic3:="9999,999.99"
      oT:cPic4:="9999,999.99"



      AFill(oT:aPar,"")
      oBPar:GoTop()
      oBPar:Refresh()
      oBPar:Disable()
   ELSE
      oT:lApp:=.F.
      oT:aDat[ 1]:=(oDCot)->NumDoc
      oT:aDat[ 2]:=(oDCot)->FecDoc
      oT:aDat[ 3]:=(oDCot)->TipSol
      oT:aDat[ 4]:=(oDCot)->NumCli
      oT:aDat[ 5]:=(oDCot)->RazSoc
      oT:aDat[ 6]:=(oDCot)->NomSol
      oT:aDat[ 7]:=(oDCot)->NomVen
      oT:aDat[ 8]:=(oDCot)->PorDes
      oT:aDat[ 9]:=(oDCot)->VigCot
      oT:aDat[10]:=(oDCot)->Credit
      oT:aDat[11]:=(oDCot)->ConEnt
      oT:aDat[12]:=(oDCot)->Nota1
      oT:aDat[13]:=(oDCot)->Nota2
      oT:aDat[14]:=(oDCot)->TipCli
      oT:aDat[15]:=IF((oDCot)->Status="C","[ Cancelata ]","[ Consulta ]")
      oT:aDat[16]:=(oDCot)->nDC
      oT:aDat[17]:=(oDCot)->nDP
      oT:aDat[19]:=(oDCot)->TipMon
      oT:aDat[20]:=(oDCot)->TipCam


      oT:aDat[21]:=(oDPre)->Camera      //NUMERO OMBRELLONE
      oT:aDat[22]:=(oDPre)->Fila         // NUMERO FILA
      oT:aDat[23]:=(oDPre)->Tipoattrez  // TIPO OMBRELLONE
      oT:aDat[24]:=(oDPre)->Dal        // DATA INIZIO
      oT:aDat[25]:=(oDPre)->Al         // DATA FINE
      oT:aDat[26]:=(oDPre)->Intera
      oT:aDat[27]:=0

      oT:aDat[32]:=(oDPre)->impacc
      oT:aDat[33]:=(oDPre)->PAGATO

      oT:cPic1:=Get_Pict((oDCot)->nDC,1)
      oT:cPic2:=Get_Pict((oDCot)->nDP,1)
      oT:cPic3:=Get_Pict((oDCot)->nDC,2)
      oT:cPic4:=Get_Pict((oDCot)->nDP,2)

   ENDIF

   oT:aDat[18]:=Control->TasIva
   oT:aTot[7]:=oT:aDat[ 10]



   (oDPar)->(DbSeek(oT:aDat[ 1]))

   DO WHILE (oDPar)->NumDoc==oT:aDat[ 1] .AND. !(oDPar)->(EoF())
      nImp:=(oDPar)->ImpPar
      oT:aTot[1]++
      oT:aTot[2]+=nImp
      oT:aTot[3]+=nImp*((oDPar)->PorDes/100)
      oT:aTot[5]+=(nImp-((oDPar)->PorDes/100))*((oDPar)->TasIva/100)
      (oDPar)->(DbSkip())
   ENDDO
   (oDPar)->(DbSeek(oT:aDat[ 1]))
   Refr_Tot()
   FOR nI=1 TO 4
     oT:oBtn[nI]:Disable()
     oT:oBtn[nI]:Refresh()
   NEXT nI
   FOR nI=1 TO 7
    oT:oPar[nI]:Disable()
    oT:oPar[nI]:Refresh()
   NEXT nI
      oT:oPar[14]:Disable()
       oT:oPar[15]:Disable()
       oT:oPar[14]:Refresh()
       oT:oPar[15]:Refresh()
   FOR nI=1 TO 13
      oT:oDat[nI]:Refresh()
   NEXT nI
   oT:oDat[20]:Refresh()

   oT:oDat[21]:Refresh()
   oT:oDat[22]:Refresh()
   oT:oDat[23]:Refresh()
   oT:oDat[24]:Refresh()
   oT:oDat[25]:Refresh()
   oT:oDat[26]:Refresh()
   oT:oDat[27]:Refresh()
   oT:oDat[28]:Refresh()
   oT:oDat[29]:Refresh()
   oT:oDat[30]:Refresh()
 

   oBPar:Refresh()
RETURN (NIL)

 



How you can see

oT:aDat[32] is 0 ( zero) can I use the clause picture ( picture "99,999,999.99") for it ?


while

oT:aDat[ 1]:=StrZero(Val((oDCot)->NumDoc)+1,5)
this is a caracter sample 00046 can I use the clause picture ( picture "99999") for it ?



the same code is for the resource dialog
oDCot:=Apri_Dbf("Cotiza",.T.,.T.,aIdx)
oT:=CA_210():New()
cVar:=aIdx[1]
(oDCot)->(OrdSetFocus(1))

....

DEFINE DIALOG oDlc RESOURCE "CAW210" FONT oApp:oFont

REDEFINE GET oT:oDat[ 1] VAR oT:aDat[ 1] ID 101 OF oDlc PICTURE "@K99999" VALID Val_Doc() WHEN oT:lNew


...
REDEFINE GET oT:oDat[32] VAR oT:aDat[32] ID 127 OF oDlc PICTURE "99,999,999.99" //ACCONTO

ACTIVATE DIALOG oDlc ;
ON INIT Carga_Datos(lNew,obtn)



why on resource dialog run ok instead of the dialog made with no resource ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Natter and 55 guests