Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

any suggestions for updating a choice field in a view?

 [1/2] from: mh983:ya:hoo at: 8-Sep-2001 22:21


I haven't found a very straight-forward way to update the selected value in a choice field. For example, perhaps you want a button click to cause the selected value in a choice field to change: view layout [ mychoice: choice "one" "two" "three" button "change it" [ mychoice/text: "two" mychoice/data: find mychoice/data mychoice/text show mychoice ] ] what I did was three steps: 1. mychoice/text: "two" ;sets the text of the choice to the desired value 2. mychoice/data: find mychoice/data mychoice/text ; finds the text in the data series and updates the series to that value 3. show mychoice ; refresh the choice field on the screen One thing to be careful with is that you can set the text of the choice to something that is not already in the list. I guess you could turn the steps around and find the item in data first, then only if it is found do you set the text. Does anyone know of an simpler way that I'm missing, or is this the way to do it? Thanks. mike

 [2/2] from: arolls::bigpond::net::au at: 9-Sep-2001 17:54


Well you could do: ch/text: first ch/data: at head ch/data 2 show ch It requires one less reference to ch. Just make sure the number ("2") is between 1 and length? ch/data. It is less "self-documenting" though it could be useful. I think your way is pretty good.