Error in program execution - Error en ejecucion del programa

Xbase++ 2.0 Build 554 or later
Post Reply
Message
Author
User avatar
Jose Marte2
Posts: 46
Joined: Thu Nov 16, 2017 2:19 pm
Location: República Dominicana

Error in program execution - Error en ejecucion del programa

#1 Post 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.
José Marte
Software & Servicios


User avatar
rdonnay
Site Admin
Posts: 4775
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

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

#2 Post by rdonnay »

I need to see your source code.

How are you calling the :new() and :create() methods of XbpStatusBar ?
The eXpress train is coming - and it has more cars.

User avatar
Jose Marte2
Posts: 46
Joined: Thu Nov 16, 2017 2:19 pm
Location: República Dominicana

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

#3 Post 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
José Marte
Software & Servicios


User avatar
rdonnay
Site Admin
Posts: 4775
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

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

#4 Post 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.
The eXpress train is coming - and it has more cars.

User avatar
Jose Marte2
Posts: 46
Joined: Thu Nov 16, 2017 2:19 pm
Location: República Dominicana

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

#5 Post 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.
José Marte
Software & Servicios


Post Reply