User Interaction
function Input(XPos,YPos,Caption,Default) Shows an input box and returns the user
input string. If the user cancelled the input box, the string 'CANCEL' is
returned.
// create a time control list containig the times of full moon
// of a year, specified by the user
var
i : integer;
year: integer;
JD : double;
begin
TimeScale := UT;
TimeShift := StdTimeZone;
year := YearFromJD(Now); // determine current year
// ask for year of calculation, use current year as default value
year := Input(50,150,'Enter year number',year);
// perform the calculation
JD := JulianDay(year,1,1,0,0,0)-5.0;
for i:= 1 to 13 do begin
JD := LunarPhase(JD,Full);
Add(JD);
JD := JD + 5.0;
end;
end;
function
Selection(XPos,YPos,Caption,Items,ItemIdx)
// show a selection with oppostion times (1990-2022) of Mars
// calculate an ephemeris of 250 values prior and 250 values after
// the user selected opposition date with a tep size of 12 hours
var s: string;
begin
TimeScale := UT;
TimeShift := StdTimeZone;
repeat
s := Selection(50,150, // the position of the selection box
'Select opposition date', // the caption
'1990-11-27;1993-01-07;1995-02-12;'+ // the items
'1997-03-17;1999-04-24;2001-06-13;'+
'2003-08-28;2005-11-07;2007-12-24;'+
'2010-01-29;2012-03-03;2014-04-08;'+
'2016-05-22;2018-07-27;2020-10-14;'+
'2022-12-08',
8); // select item index 8 (2007-12-24)
until (s <> 'CANCEL');
// perform the calculation (250 steps prior and after the selected date)
JD0 := s; // the result from the selection
StepsA := 250;
StepsB := 250;
StepSize := '12:00'; // 12 hours
CreateList;
Goto(JD0); // select row that corresponds to selection
end;
Selects that row of the ephemeris table that corresponds to the time specified by JD. Alcyone Ephemeris
Documentation |