Home > functions > job > job_plot_currentmap_dir > private > vb_table_query_update_flag.m

vb_table_query_update_flag

PURPOSE ^

get update_flag from table.

SYNOPSIS ^

function [update_flag] = vb_table_query_update_flag(tbl, key)

DESCRIPTION ^

 get update_flag from table.
 [USAGE]
    [update_flag] = vb_table_query_update_flag(tbl, key);
 [IN]
    tbl : table data.
    key : search key.
 [OUT]
    update_flag : update_flag in the specified record.

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [update_flag] = vb_table_query_update_flag(tbl, key)
0002 % get update_flag from table.
0003 % [USAGE]
0004 %    [update_flag] = vb_table_query_update_flag(tbl, key);
0005 % [IN]
0006 %    tbl : table data.
0007 %    key : search key.
0008 % [OUT]
0009 %    update_flag : update_flag in the specified record.
0010 %
0011 % Copyright (C) 2011, ATR All Rights Reserved.
0012 % License : New BSD License(see VBMEG_LICENSE.txt)
0013 
0014 %
0015 % --- Previous check
0016 %
0017 if ~exist('tbl', 'var')
0018     error('tbl is a required parameter.');
0019 end
0020 if ~exist('key', 'var')
0021     error('key is a required parameter.');
0022 end
0023 if ~ischar(key)
0024     error('key should be string.');
0025 end
0026 
0027 
0028 %
0029 % --- Main Procedure
0030 %
0031 update_flag = [];
0032 
0033 if ~isempty(tbl)
0034     if ~isfield(tbl(1), 'update_flag')
0035         error('Specified table doesn''t have ''update_flag'' field.');
0036     end
0037     ix = strmatch(key, {tbl.key}, 'exact');
0038     if ~isempty(ix)
0039         update_flag = tbl(ix).update_flag;
0040     end
0041 end

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005