1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-14 05:15:16 -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 begin
if InputQuery('DTM From String', 'Enter DTM string:', s) and (s <> '') then if InputQuery('DTM From String', 'Enter DTM string:', s) and (s <> '') then
begin 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); mdtm := GetDTM(dtm);
sdtm := MDTMToSDTM(mdtm); sdtm := MDTMToSDTM(mdtm);
@ -1354,3 +1360,5 @@ begin
ThreadSafe_ShowForm; ThreadSafe_ShowForm;
{$endif} {$endif}
end. end.