REM > JLibraries:Libs.1
REM © James Bursa, 1997

REM JB  19 Nov 1997     created


DEF PROCLibs_Load(Dire$)
LOCAL Buff%, BuffB%, Read%

Buff% = FNHeap_Alloc(64)
IF Buff% = 0 THEN ERROR Erro_Memo%, ""
BuffB% = !Buff%

Read% = 0

 REPEAT
   IF RIGHT$(Dire$, 1) = "." THEN
    SYS"OS_GBPB", 12, LEFT$(Dire$), BuffB%, 1, Read%, 64, 0 TO ,,,, Read%
   ELSE
    SYS"OS_GBPB", 12, Dire$, BuffB%, 1, Read%, 64, 0 TO ,,,, Read%
   ENDIF
   IF (Read% <> -1) AND (BuffB%!20 = &FFB) THEN
    LIBRARY Dire$+FNWimp_GetString(BuffB% + 24)
   ENDIF
   IF (Read% <> -1) AND (BuffB%!20 = &1000) THEN
    PROCLibs_Load(Dire$+FNWimp_GetString(BuffB% + 24)+".")
   ENDIF
 UNTIL Read% = -1

PROCHeap_Free(Buff%)
ENDPROC
