AYUDA! Error BASE/1089 Error de argumento: ABS

AYUDA! Error BASE/1089 Error de argumento: ABS

Postby AIDA » Tue Nov 22, 2022 6:00 pm

Hola me salio un error :shock: que no comprendo :?: me pueden orientar
Gracias. :wink:


ya lo repare solo quite el cFile := LFN2SFN( cFile ) y dejo de salir el error :mrgreen:

el error sale cuando se ejecutan estas mini funciones

Code: Select all  Expand view  RUN
//----------------------------------------------------------------------------//
 FUNCTION playfile( cFile )
   cFile := LFN2SFN( cFile )

   IF File( cFile )
    audiop( ("Play " + cFile) )
   ENDIF

   RETURN NIL


FUNCTION stopfile( cFile )
   cFile := LFN2SFN( cFile )

   IF File( cFile )
    audiop( ("Stop " + cFile) )
   ENDIF

   RETURN NIL
 //--------------------------------------------------------------------------//


Stack Calls
===========
Called from: => ABS( 0 )
Called from: .\source\function\LONGNAM2.PRG => GETSHORTPATHNAME( 0 )
Called from: .\source\function\LONGNAM2.PRG => LFN2SFN( 70 )
Called from: model.prg => STOPFILE( 14753 )
Called from: model.prg => (b)COMO( 14388 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 792 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 1083 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1847 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 2135 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3689 )
Called from: => DIALOGBOX( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 307 )
Called from: model.prg => COMO( 14398 )
Called from: model.prg => (b)REGISTRAME( 14314 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 1100 )
Called from: model.prg => REGISTRAME( 14314 )
Called from: model.prg => MAIN( 731
Last edited by AIDA on Tue Nov 22, 2022 6:38 pm, edited 2 times in total.
Que es mejor que programar? creo que nada :)
Atropellada pero aqui ando :P

I love Fivewin

séʌǝɹ ןɐ ɐʇsǝ opunɯ ǝʇsǝ
User avatar
AIDA
 
Posts: 879
Joined: Fri Jan 12, 2007 8:35 pm

Re: Error BASE/1089 Error de argumento: ABS

Postby karinha » Tue Nov 22, 2022 6:21 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7828
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: AYUDA! Error BASE/1089 Error de argumento: ABS

Postby karinha » Tue Nov 22, 2022 6:27 pm

C:\FWH..\sample\testlfn2.prg

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7828
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: AYUDA! Error BASE/1089 Error de argumento: ABS

Postby karinha » Tue Nov 22, 2022 6:30 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7828
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: AYUDA! Error BASE/1089 Error de argumento: ABS

Postby AIDA » Tue Nov 22, 2022 8:42 pm

GRACIAS! :D


karinha wrote:C:\FWH..\sample\testlfn2.prg

Regards, saludos.
Que es mejor que programar? creo que nada :)
Atropellada pero aqui ando :P

I love Fivewin

séʌǝɹ ןɐ ɐʇsǝ opunɯ ǝʇsǝ
User avatar
AIDA
 
Posts: 879
Joined: Fri Jan 12, 2007 8:35 pm

Re: AYUDA! Error BASE/1089 Error de argumento: ABS

Postby Antonio Linares » Tue Nov 22, 2022 9:18 pm

Querida Aida,

Si usas xHarbour, entonces ese error se debe a que se enlazan las funciones LoadLibrary() y FreeLibrary() de xHarbour en vez de las de FWH.

Observa que en DLL.CH se llama a Abs() y si se le pasa un valor tipo "P" (que es lo que devuelve LoadLibrary() de xHarbour) se genera un error en Abs()

Necesitas usar este DLL.CH actualizado ó usar la versión más reciente (ojo que hemos publicados varios builds de FWH 22.10) de FWH :-)
Code: Select all  Expand view  RUN
// Copyright FiveTech 1993-2011

#ifndef _DLL_CH
#define _DLL_CH

#ifndef _C_TYPES
   #define _C_TYPES
   #define VOID      0
   #define BYTE      1
   #define CHAR      2
   #define WORD      3

#ifdef __CLIPPER__
   #define _INT      4         // conflicts with Clipper Int()
#else
   #define _INT      7
#endif

   #define BOOL      5
   #define HDC       6
   #define LONG      7
   #define STRING    8
   #define LPSTR     9
   #define PTR      10
   #define _DOUBLE  11         // conflicts with BORDER DOUBLE
   #define DWORD    12
   
   #define LONGLONG 13
#endif

#translate NOREF([@]<x>) => <x>

#ifndef __HARBOUR__
  #ifndef __XPP__
     #ifndef __CLIPPER__
        #ifndef __C3__
           #define __CLIPPER__
        #endif
     #endif
  #endif
#endif

#ifndef __CLIPPER__
   #translate DLL32 => DLL
#endif

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

#xcommand DLL [<static:STATIC>] FUNCTION <FuncName>( [ <uParam1> AS <type1> ] ;
                                                     [, <uParamN> AS <typeN> ] ) ;
             AS <return> [<pascal:PASCAL>] [ FROM <SymName> ] LIB <*DllName*> ;
       => ;
          [<static>] function <FuncName>( [NOREF(<uParam1>)] [,NOREF(<uParamN>)] ) ;;
             local _hDLL := If( ValType( <DllName> ) == "N", <DllName>, LoadLibrary( <(DllName)> ) ) ;;
             local uResult ;;
             local cFarProc ;;
             local _pOld ;;
             if ValType( _hDLL ) == "P" ;;
               _pOld = _hDLL ;;
               _hDLL = PtrToNum( _hDLL ) ;;
             end ;;
             if Abs( _hDLL ) > 32 ;;
                cFarProc = GetProcAdd( _hDLL,;
                If( [ Empty( <SymName> ) == ] .t., <(FuncName)>, <SymName> ),;
                [<.pascal.>], <return> [,<type1>] [,<typeN>] ) ;;
                uResult = FWCallDLL( cFarProc [,<uParam1>] [,<uParamN>] ) ;;
                if ! Empty( _pOld ) ;;
                   _hDLL = _pOld ;;
                end ;;  
                If( ValType( <DllName> ) == "N",, FreeLibrary( _hDLL ) ) ;;
             else ;;
                MsgAlert( "Error code: " + LTrim( Str( _hDLL ) ) + " loading " + ;
                If( ValType( <DllName> ) == "C", <DllName>, Str( <DllName> ) ) ) ;;
             end ;;
          return uResult

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

#xcommand DLL32 [<static:STATIC>] FUNCTION <FuncName>( [ <uParam1> AS <type1> ] ;
                                                      [, <uParamN> AS <typeN> ] ) ;
             AS <return> [<pascal:PASCAL>] [ FROM <SymName> ] LIB <*DllName*> ;
       => ;
          [<static>] function <FuncName>( [NOREF(<uParam1>)] [,NOREF(<uParamN>)] ) ;;
             local _hDLL := If( ValType( <DllName> ) == "N", <DllName>, LoadLib32( <(DllName)> ) ) ;;
             local uResult ;;
             local cFarProc ;;
             if Abs( _hDLL ) <= 32 ;;
                MsgAlert( "Error code: " + LTrim( Str( _hDLL ) ) + " loading " + <DllName> ) ;;
             else ;;
                cFarProc = GetProc32( _hDLL,;
                If( [ Empty( <SymName> ) == ] .t., <(FuncName)>, <SymName> ),;
                [<.pascal.>], <return> [,<type1>] [,<typeN>] ) ;;
                uResult = FWCallDLL32( cFarProc [,<uParam1>] [,<uParamN>] ) ;;
                If( ValType( <DllName> ) == "N",, FreeLib32( _hDLL ) ) ;;
             end ;;
          return uResult

#endif

//----------------------------------------------------------------------------//
regards, saludos

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


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 49 guests