73 lines
1.7 KiB
Brainfuck
Executable File
73 lines
1.7 KiB
Brainfuck
Executable File
********************************************************************************
|
|
*
|
|
* Support of PR1ME INFORMATION subroutine '!MATCHES'
|
|
*
|
|
* Module %M% Version %I% Date %H%
|
|
*
|
|
* (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved
|
|
* This is unpublished proprietary source code of Ardent Software Inc.
|
|
* The copyright notice above does not evidence any actual or intended
|
|
* publication of such source code.
|
|
*
|
|
*******************************************************************************
|
|
*
|
|
* Maintenence log - insert most recent change descriptions at top
|
|
*
|
|
* Date.... GTAR# WHO Description.........................................
|
|
* 10/14/98 23801 SAP Change copyrights.
|
|
* 09/07/93 12299 LA Initial implementation.
|
|
*
|
|
*******************************************************************************
|
|
|
|
$OPTIONS DEFAULT
|
|
|
|
subroutine PR1ME(ANSWER, A, B)
|
|
|
|
EQU DEFAULTA TO ''
|
|
EQU DEFAULTB TO ''
|
|
*
|
|
ANSWER=''
|
|
* CHECK FOR REUSE OF A AND B
|
|
A.REP = SYSTEM(1020, A)
|
|
B.REP = SYSTEM(1020, B)
|
|
|
|
*
|
|
*
|
|
A=A
|
|
B=B
|
|
*
|
|
*
|
|
A:
|
|
REMOVE AA FROM A SETTING ALIM
|
|
B:
|
|
REMOVE BB FROM B SETTING BLIM
|
|
MARK:
|
|
MARK=IF ALIM >= BLIM THEN ALIM ELSE BLIM
|
|
DELIM=CHAR(256-MARK)
|
|
ASSIGN:
|
|
ANSWER:=(AA MATCHES BB) : DELIM
|
|
CHECK:
|
|
IF ALIM=BLIM THEN
|
|
IF ALIM=0 THEN GOTO DONE
|
|
GOTO A
|
|
END
|
|
IF ALIM>BLIM THEN
|
|
IF NOT(B.REP) THEN BB=DEFAULTB
|
|
GOTO NEXTB
|
|
END
|
|
IF ALIM<BLIM THEN
|
|
IF NOT(A.REP) THEN AA=DEFAULTA
|
|
GOTO B
|
|
END
|
|
*
|
|
NEXTB:
|
|
REMOVE AA FROM A SETTING ALIM
|
|
GOTO MARK
|
|
|
|
|
|
DONE:
|
|
ANSWER=ANSWER[1,LEN(ANSWER)-1]
|
|
RETURN
|
|
|
|
END
|