Page 1 of 1

Error in program execution - Error en ejecucion del programa

Posted: Thu Mar 22, 2018 1:01 pm
by Jose Marte2
Ingles: Greetings to all, I hope you are well. Please if someone can help me with this error that is activated in some pc that have my billing program installed, not in all the pc in some. Thank you

Base Error / 3
Description: Parameters have a wrong data type Operation: <NIL> + <2>
Thread ID: 3
Called from XBPSTATUSBAR: ONTIMEREVENT (1341)
Called from (B) XBPSTATUSBAR: CREATE (685)

Sorry for the inconvenience, Thank you very much.

Español: Saludos a todos, espero que estén bien. Por favor, si alguien puede ayudarme con este error que se activa en algunas computadoras que tienen mi programa de facturación instalado, no en todas las computadoras. Gracias

Error base / 3
Descripción: Los parámetros tienen un tipo de datos incorrecto. Operación: <NIL> + <2>
ID del hilo: 3
Llamado desde XBPSTATUSBAR: ONTIMEREVENT (1341)
Llamado desde (B) XBPSTATUSBAR: CREATE (685)

Perdón por la inconveniencia, muchas gracias.

Re: Error in program execution - Error en ejecucion del prog

Posted: Thu Mar 22, 2018 1:12 pm
by rdonnay
I need to see your source code.

How are you calling the :new() and :create() methods of XbpStatusBar ?

Re: Error in program execution - Error en ejecucion del prog

Posted: Thu Mar 22, 2018 1:27 pm
by Jose Marte2
rdonnay wrote:I need to see your source code.

How are you calling the :new() and :create() methods of XbpStatusBar ?


//Crear Barra de Estado
oSBar:= XbpStatusBar():new( oDlgSisAdco:drawingArea )
oSBar:create( ,, {0,0}, {oDlgSisAdco:drawingArea:currentSize()[1],30} )

oPanel:= oSBar:getItem( 1 )
oPanel:caption := "USUARIO: "+AllTrim(cNomUsu)
oPanel:autosize := XBPSTATUSBAR_AUTOSIZE_SPRING

oPanel:= oSBar:addItem()
oPanel:= oSBar:getItem( 2 )
oPanel:caption := AllTrim("CAJA "+AllTrim(nCaja))
oPanel:autosize := XBPSTATUSBAR_AUTOSIZE_CONTENTS

oPanel:= oSBar:addItem()
oPanel:= oSBar:getItem( 3 )
oPanel:caption := AllTrim("w"+AllTrim(cNumTer))
oPanel:autosize := XBPSTATUSBAR_AUTOSIZE_CONTENTS

IF mcImpFiscal == "S"
oPanel:= oSBar:addItem()
oPanel:= oSBar:getItem( 4 )
oPanel:caption := "SUCURSAL "+cSucursal
oPanel:autosize := XBPSTATUSBAR_AUTOSIZE_CONTENTS

oPanel:= oSBar:addItem()
oPanel:= oSBar:getItem( 5 )
oPanel:caption := "TASA ACTUAL US$ "+TransForm(nTasa,"99.99")
oPanel:autosize := XBPSTATUSBAR_AUTOSIZE_CONTENTS

oPanel:= oSBar:addItem()
oPanel:= oSBar:getItem( 6 )
oPanel:caption := "FECHA ACTUAL "+Dtoc(Date())
oPanel:autosize := XBPSTATUSBAR_AUTOSIZE_CONTENTS

ELSE
oPanel:= oSBar:addItem()
oPanel:= oSBar:getItem( 4 )
oPanel:caption := "TASA ACTUAL US$ "+TransForm(nTasa,"99.99")
oPanel:autosize := XBPSTATUSBAR_AUTOSIZE_CONTENTS

oPanel:= oSBar:addItem()
oPanel:= oSBar:getItem( 5 )
oPanel:caption := "FECHA ACTUAL "+Dtoc(Date())
oPanel:autosize := XBPSTATUSBAR_AUTOSIZE_CONTENTS
ENDIF

oPanel:= oSBar:addItem()
oPanel:Style := XBPSTATUSBAR_PANEL_TIME
oPanel:autosize := XBPSTATUSBAR_AUTOSIZE_CONTENTS

oPanel:= oSBar:addItem()
oPanel:Style := XBPSTATUSBAR_PANEL_CAPSLOCK
oPanel:autosize := XBPSTATUSBAR_AUTOSIZE_CONTENTS

oPanel:= oSBar:addItem()
oPanel:Style := XBPSTATUSBAR_PANEL_NUMLOCK
oPanel:autosize := XBPSTATUSBAR_AUTOSIZE_CONTENTS

oPanel:= oSBar:addItem()
oPanel:Style := XBPSTATUSBAR_PANEL_INSERT
oPanel:autosize := XBPSTATUSBAR_AUTOSIZE_CONTENTS

CrearMenu(oDlgSisAdco)

oPanel:= oSBar:getItem( 1 )
oPanel:caption := "USUARIO: "+AllTrim(cNomUsu)
oPanel:autosize := XBPSTATUSBAR_AUTOSIZE_SPRING

Re: Error in program execution - Error en ejecucion del prog

Posted: Thu Mar 22, 2018 1:55 pm
by rdonnay
It appears that you are running a different version of XbpStatusBar than the one that I have installed with Xbase++ 2.0

The line number of OnTimerEvent() doesn't match the source code.

Alaska Software gives us the source code for XbpStatusBar. It is based on a Windows ActiveX control.

It appears that you are running Xbase++ build 355.
The source for XbpStatusBar is in \alaska\xppw32\source\sys\axctrls.prg

The offending line of code is this:

Code: Select all

   FOR i:=1 TO ::ItemsCollection:NumItems()
      oPanel := ::ItemsCollection:GetItem( i )
      nStyle := oPanel:Style
      IF nStyle != XBPSTATUSBAR_PANEL_CAPSLOCK .AND. ;
         nStyle != XBPSTATUSBAR_PANEL_NUMLOCK  .AND. ;
         nStyle != XBPSTATUSBAR_PANEL_INSERT   .AND. ;
         nStyle != XBPSTATUSBAR_PANEL_SCROLL
         LOOP
      ENDIF

      aRect := { oPanel:Left +2, 2, oPanel:Left + ;   <<<<<<<<<<<<<<<< error here
                 oPanel:Width -2, ::CurrentSize()[2] }

      IF ::SizeGrip == .T. .AND. ::GripIsChild == .T. .AND. ;
         aPos[1] > aRect[1] .AND. aPos[1] < aRect[3]
         aRect[3] := aPos[1]
      ENDIF

      PostAppEvent( xbeSBAR_AsyncRefresh, aRect, NIL, self )
   NEXT
You need to see why oPanel:Left is a NIL.

Re: Error in program execution - Error en ejecucion del prog

Posted: Thu Mar 22, 2018 2:12 pm
by Jose Marte2
rdonnay wrote:It appears that you are running a different version of XbpStatusBar than the one that I have installed with Xbase++ 2.0

The line number of OnTimerEvent() doesn't match the source code.

Alaska Software gives us the source code for XbpStatusBar. It is based on a Windows ActiveX control.

It appears that you are running Xbase++ build 355.
The source for XbpStatusBar is in \alaska\xppw32\source\sys\axctrls.prg

The offending line of code is this:

Code: Select all

   FOR i:=1 TO ::ItemsCollection:NumItems()
      oPanel := ::ItemsCollection:GetItem( i )
      nStyle := oPanel:Style
      IF nStyle != XBPSTATUSBAR_PANEL_CAPSLOCK .AND. ;
         nStyle != XBPSTATUSBAR_PANEL_NUMLOCK  .AND. ;
         nStyle != XBPSTATUSBAR_PANEL_INSERT   .AND. ;
         nStyle != XBPSTATUSBAR_PANEL_SCROLL
         LOOP
      ENDIF

      aRect := { oPanel:Left +2, 2, oPanel:Left + ;   <<<<<<<<<<<<<<<< error here
                 oPanel:Width -2, ::CurrentSize()[2] }

      IF ::SizeGrip == .T. .AND. ::GripIsChild == .T. .AND. ;
         aPos[1] > aRect[1] .AND. aPos[1] < aRect[3]
         aRect[3] := aPos[1]
      ENDIF

      PostAppEvent( xbeSBAR_AsyncRefresh, aRect, NIL, self )
   NEXT
You need to see why oPanel:Left is a NIL.
Thank you, thank you very much, Mr.