GSAK (Geocaching Swiss Army Knife)
EditForm(sForm, sName, sProperty, sValue) : string
This function allows you to change individual properties in your form variable. After making the required changes you would then normally use the Form() function again to redisplay the changed form.
sForm - This is the form variable to edit
sName - This is the name of the control to change
sProperty - This is the name of the property to change (the property of the corresponding sName control)
sValue - This is value you want to allocate to sProperty
After accepting input from the user you may want to redisplay the form with some of the properties changed. Rather than have to create the whole form again with a new set of <data> statements you can use this function to just change the properties required. In the following example we want to change the label data when the user makes a selection from the drop down box. The ComboBox has the "ExitOnChange" property set to "Yes" which means that as soon as a value in the ComboBox changes the form will exit. This enables us to test the selected value in the ComboBox, then use EditForm() to change our corresponding label. We could of course perform other calculations and do other Editing of properties on the form if required.
The above code uses a while loop to continually show the form when the ComboBox changes. Any other method to exit the form will break out of this loop.
So when the form is initially shown we see this:
If we select "Steak" from the drop down list, we immediately see:
Alpha List Category List
Copyright 2004-2013 CWE Computer Services |