Module: _dbjoin      Library: Clipper 5.3


This module contains the following functions and procedures:



Note: Because this is raw decompiler output, the code is closer
to that seen in a .PPO file, rather than a .PRG file. In other
words, you must allow for the preprocessor conversions normally 
performed based on the contents of STD.CH and other .CH files
 
#include "common.ch"
#include "inkey.ch"

//---------------------------------------------------[top]-
//  __DBJOIN( Arg1, Arg2, Arg3, Arg4 )
//
function __DBJOIN( Arg1, Arg2, Arg3, Arg4 )

   local Local1, Local2, Local3, Local4, Local5, Local6, Local7 := .F.
   Local1 := Select()
   Local2 := Select(Arg1)
   select (Local1)
   if ( Empty(Local4 := fieldtwo(Arg1, Arg3)) )
      return .F.
   endif
   begin sequence
      dbcreate(Arg2, Local4, .T., .T., "")
      Local3 := Select()
      Local5 := __joinlist(Local1, Local2, Local3, Local4)
      select (Local1)
      goto top
      do while ( !EOF() )
         select (Local2)
         goto top
         do while ( !EOF() )
            select (Local1)
            if ( eval(Arg4) )
               __dojoinli(Local5)
            endif
            select (Local2)
            skip 
         enddo
         select (Local1)
         skip 
      enddo
   recover using Local6
      Local7 := .T.
   end sequence
   if ( Local3 != Nil )
      select (Local3)
      close
   endif
   select (Local1)
   if ( Local7 )
      break( Local6 )
   endif
   return .T.

//---------------------------------------------------[top]-
//  FIELDTWO( Arg1, Arg2 )
//
static function FIELDTWO( Arg1, Arg2 )

   local Local1, Local2, Local3, Local4
   if ( Empty(Arg2) )
      return dbstruct()
   endif
   Local1 := {}
   aeval(Arg2, { |_1| AAdd(Local1, Trim(Upper(_1))) })
   Arg2 := Local1
   Local4 := {}
   Local2 := { |_1| _1 == Local3 }
   aeval(dbstruct(), { |_1| ( Local3 := _1[ 1 ], iif( ascan(Arg2, ;
      Local2) == 0, Nil, AAdd(Local4, _1) ) ) })
   select (Arg1)
   Local2 := { |_1| "->" $ _1 .AND. SubStr(_1, At("->", _1) + 2) == ;
      Local3 }
   aeval(dbstruct(), { |_1| ( Local3 := _1[ 1 ], iif( ascan(Arg2, ;
      Local2) == 0, Nil, AAdd(Local4, _1) ) ) })
   return Local4

//---EOF


Use your Browser's BACK button to return to Function Listings