From: Walter Roberson on
aashay vanarase wrote:
> i hav designed a drop down list in my gui that contains list of files
> present in a folder... but these files are diff each time the folder
> changes...

> so how do i get the handles for strings that change.. i cant set the
> 'value' as i dont kno no. of files in the folder...

I'm not entirely sure what you are asking.

If you want to find out which file was selected, then get() the Value of the
uicontrol, and get() the String property of the uicontrol, and index the
String property by the value.

Note: when you are doing this, use iscell() to determine whether the String
property returned a cell array or a character array. If it returned a cell
array, then the file name is

TheVariableName{TheIndex}

However, if it returned a character array, then the file name is

deblank(TheVariableName(TheIndex,:))


> can 'case' be used
> while incrementing an array, where the array elements are
> conditionalities of the case statemnt


Yes it can, but that is an advanced and obscure technique, and I very much
doubt that you really want to do that. Such code is almost always better off
written as an if/elseif/elseif/end flow, or as a while statement that contains
an if condition.