{
    "header": {
        "version": 1,
        "type": "record"
    },
    "body": {
        "record1": {
            "<1>": "declare function rowexists, msg, fieldcount\r\n$insert msg_equates\r\n$insert logical\r\n\r\nif .type->value <> '' then\r\n   if .orientation->value <> '' then\r\n\t   TWError = false$\r\n\t   CurArray = .tw_info->array\r\n\t   NumRows = fieldcount( CurArray<1>, @vm ) +1 ;* JUST INCASE FIRST VALUE NULL\r\n\t   for i = 1 to NumRows\r\n\t      if CurArray<1,i> <> '' then\r\n\t         * check to see if they have entered a loss code for every\r\n\t         * row with rejects in it\r\n\t         if CurArray<2,i> <> '' else\r\n\t            TWError = true$\r\n\t         end\r\n\t      end else\r\n\t         if CurArray<2,i> = '' then\r\n\t            * blank line\r\n\t         end else\r\n\t            TWError = true$\r\n\t         end\r\n\t      end\r\n\t    until TWError\r\n\t   next i\r\n\t   if TWError then\r\n\t         MsgInfo = ''\r\n\t         MsgInfo<micon$> = 'H'\r\n\t         MsgInfo<mtext$> = 'You must have test wafers and a usage code for every row that contains and entry!'\r\n\t         Void = msg( '', MsgInfo )\r\n\t      return 0\r\n\t   end\r\n\t\tif rowexists( 'TW_USAGE', .twu_id->text ) else\r\n\t\t   .entry_id->text = @user4\r\n\t\tend\r\n\t\treturn 1\r\n\tend else\r\n\t    MsgInfo = ''\r\n\t    MsgInfo<micon$> = 'H'\r\n\t    MsgInfo<mtext$> = 'You must choose an orientation...<100>, <111>.'\r\n\t    Void = msg( '', MsgInfo )\r\n\t    return 0\r\n\tend\r\nend else\r\n    MsgInfo = ''\r\n    MsgInfo<micon$> = 'H'\r\n    MsgInfo<mtext$> = 'You must choose a test wafer type...P+, P-, N+, N-.'\r\n    Void = msg( '', MsgInfo )\r\n    return 0\r\nend\r\n"
        }
    }
}