{
    "header": {
        "version": 1,
        "type": "record"
    },
    "body": {
        "record1": {
            "<1>": "declare function create_bmp_entity, fieldcount, popup, start_window, utility, rds_comm2, msg\r\n$insert popup_equates\r\n$insert msg_equates\r\n\r\nequ SRPProfilePath$ to 'P:\\SRPScans'\r\n\r\nRDS = .rds_no->text\r\nCurArray = .srp_profiles->array\r\nCCnt = fieldcount( CurArray, @vm )\r\nTcnt = 0\r\nPVals = ''\r\nfor i = 1 to CCnt\r\n   if ( CurArray<1,i> <> '' ) then\r\n      Tcnt += 1   \r\n      PVals<1,-1> = 'Profile ':i\r\n   end\r\nnext i\r\nChoosen = 'New' ;* ASSUME THEY ARE CREATING A NEW ONE\r\nif ( PVals <> '' ) then\r\n   OverRide = ''\r\n   OverRide<pdisplay$> = PVals:@vm:'New'\r\n   Choosen = Popup( @window, OverRide, 'SRP_PROFILES' )\r\nend\r\nBMPPointer = 0\r\nif Choosen = 'New' then\r\n   BMPPointer = create_bmp_entity( RDS, SRPProfilePath$ )\r\n   if BMPPointer <> 0 then\r\n      * CHECK TO SEE IF IT ALREADY EXISTS SO DON'T ADD IT\r\n      locate BMPPointer in CurArray using @vm setting Fpos then\r\n         MsgInfo = ''\r\n         MsgInfo<mtext$> = 'This profile is already attached...'\r\n         MsgInfo<micon$> = '!'\r\n         Void = msg( '', MsgInfo )         \r\n      end else\r\n         CurArray<1,Tcnt+1> = BMPPointer   \r\n         .srp_profiles->array = CurArray\r\n         MsgInfo = ''\r\n         MsgInfo<mtext$> = 'This RDS successfully points to this RDS...'\r\n         MsgInfo<micon$> = '!'\r\n         Void = msg( '', MsgInfo )\r\n         @@window->savewarn = 1\r\n      end\r\n   end\r\nend else\r\n   if Choosen <> '' then\r\n      * GET IT DOWN TO THE NUMBER SO WE CAN REMOVE IF THEY CHOOSE 'Remove'\r\n      convert @upper_case to '' in Choosen\r\n      convert @lower_case to '' in Choosen\r\n      convert ' ' to '' in Choosen\r\n      OrigChoosen = Choosen\r\n      OverRide = ''\r\n\t  OverRide<pdisplay$> = 'View':@vm:'Remove'\r\n\t  Choosen = Popup( @window, OverRide, 'SRP_PROFILES' )\r\n\t  if Choosen = 'Remove' then\r\n\t     CurArray = delete( CurArray, 1, OrigChoosen, 0 )\r\n\t     .srp_profiles->array = CurArray\r\n\t  end else\r\n\t     * CALL THE RDS_SRP WINDOW AND ALLOW VIEWING OF THIS PROFILE\r\n\t     Param = CurArray<1,OrigChoosen>\r\n\t     Stat = utility( 'CURSOR', 'H' )\r\n         Void = start_window ( 'RDS_SRP', @window, Param, '', '' )\r\n\t  end\r\n   end else\r\n      * USER PRESSED CANCEL\r\n   end\r\nend\r\nVoid = rds_comm2('SET_SRP_PROFILE')\r\nRETURN 0"
        }
    }
}