Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. blockVal = get(hObject,'String');
  2. % TLTL appears in 1st row, 1st column
  3. % This should error check to make sure the string is between 0 and 9
  4. % 1st expression tests if blockVal is all numbers, 2nd expression
  5. % tests if blockVal is less than 0, 3rd expression tests if blockVal is
  6. % greater than 9, 4th expression tests if blockVal is an integer
  7. if (~(isstrprop(blockVal,'digit'))) || (str2num(blockVal) < 0) || ...
  8. (str2num(blockVal) > 9) || (isinteger(str2num(blockVal)))
  9. % Error about one digit numerics only
  10. errordlg('Block entries must be limited to the integers 0 to 9. 0 denotes any number possible.'...
  11. ,'One Digit Numeric Integers Only');
  12. else
  13. puzzle(1,1).block = blockVal;
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement