1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-11 20:05:03 -05:00

DTM Editor: Catch exception in case of invalid DTM

This commit is contained in:
Merlijn Wajer 2011-01-15 12:22:16 +01:00
parent 29082f6a9f
commit fa4d89446b

View File

@ -678,9 +678,15 @@ var
begin
if InputQuery('DTM From String', 'Enter DTM string:', s) and (s <> '') then
begin
mnuNew(nil);
try
dtm := DTMFromString(Trim(s));
except
if (MessageDlg('Invalid DTM', 'Invalid string! Make sure you only enter the string (without quotes), not stuff like "DTM := DTMFromString("!', mtError, [mbOk, mbCancel] {$ifdef PS_EXTENSION}, 0{$endif}) = 1) then
mnuDTMfromString(Sender);
Exit;
end;
dtm := DTMFromString(s);
mnuNew(nil);
mdtm := GetDTM(dtm);
sdtm := MDTMToSDTM(mdtm);
@ -1354,3 +1360,5 @@ begin
ThreadSafe_ShowForm;
{$endif}
end.