GetNextItem - Get next item from a Batch object (iterator mode). This is a helper class to easily read and parse batch files. USAGE [b,item,line] = GetNextItem(b); b batch object
0001 %GetNextItem - Get next item from a Batch object (iterator mode). 0002 % 0003 % This is a helper class to easily read and parse batch files. 0004 % 0005 % USAGE 0006 % 0007 % [b,item,line] = GetNextItem(b); 0008 % 0009 % b batch object 0010 0011 % Copyright (C) 2007 by Michaƫl Zugaro 0012 % 0013 % This program is free software; you can redistribute it and/or modify 0014 % it under the terms of the GNU General Public License as published by 0015 % the Free Software Foundation; either version 3 of the License, or 0016 % (at your option) any later version. 0017 0018 function [b,item,line] = GetNextItem(b) 0019 0020 % Check number of parameters 0021 if nargin ~= 1, 0022 error('Incorrect number of parameters (type ''help <a href="matlab:help GetNextItem">GetNextItem</a>'' for details).'); 0023 end 0024 0025 b.currentItem = b.currentItem+1; 0026 b.currentField = 0; 0027 if b.currentItem > size(b.field,1), 0028 item = []; 0029 line = []; 0030 else 0031 item = b.currentItem; 0032 line = b.line(item); 0033 end