Home > database > map_form_names_to_ids.m

map_form_names_to_ids

PURPOSE ^

Calls form_name_defs an maps form names to their IDs

SYNOPSIS ^

function [ids] = map_form_names_to_ids(names)

DESCRIPTION ^

 Calls form_name_defs an maps form names to their IDs

 [ids] = map_form_names_to_ids(names,map);

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [ids] = map_form_names_to_ids(names)
0002 % Calls form_name_defs an maps form names to their IDs
0003 %
0004 % [ids] = map_form_names_to_ids(names,map);
0005 %
0006 
0007 form_name_defs;  % Get list of form name mappings
0008 
0009 if ~iscell(names)
0010   names = {names};
0011 end
0012 
0013 nid = length(names);
0014 ids = zeros(nid,1);
0015 
0016 % Get a listing of the field names
0017 [form_list_mask, form_list_loc] = ...
0018     ismember(names,{form_name_id_const_map{:,1}});
0019 
0020 for iid = 1:nid
0021   loc = form_list_loc(iid);
0022   if loc
0023     ids(iid) = form_id_const.(form_name_id_const_map{loc,2});
0024   end
0025 end % for iid

Generated on Wed 20-Sep-2023 04:00:50 by m2html © 2003