Script Improvement Advice
Paul Charlesworth
pcharles at mtu.edu
Thu Jun 5 04:32:03 EDT 2003
Dear All:
I am working on my first ever programming project, a simple periodic
table, and have created the interface using colored buttons. At the
bottom of the screen I have an area with elemental properties. This is
basically a Tab area (for future options) and a series of fields for
each property.
What I would like to know is the most elegant beginners way to script
the placement of properties into each field on pressing an element
button. At this point I am adding the following script to each button:
on mouseup
put "Hydrogen" into field "ElementNameField"
put "1" into field "AtomicNumberField"
put "1.008" into field "AtomicMassField"
put "37" into field "AtomicRadiusField"
put "N/A" into field "IonicRadiusField"
put "1" into field "OxidationStatesField"
put "gas" into field "StateField"
put "8.9E-5" into field "DensityField"
put "-259" into field "MeltingPointField"
put "-253" into field "BoilingPointField"
put "0.12" into field "HeatFusionField"
put "0.90" into field "HeatVapField"
put "14.90" into field "SpecificHeatField"
put "0.002" into field "ThermalCondField"
put "13.60" into field "IonizationEnergyField"
put "0.75" into field "ElectronAffinityField"
put "2.2" into field "ElectronegativityField"
put "1400" into field "AbundanceField"
end mouseup
It works great, but I hoping to learn if there was a better way that
might improve speed or save file size. My next questions will probably
be about icons, about boxes, building, and distribution.
Many thanks,
Paul
More information about the use-livecode
mailing list