diff --git a/trimsp/src/TrimSPGUI/TrimSPGUI.pl b/trimsp/src/TrimSPGUI/TrimSPGUI.pl index 860de7e..76fbf3e 100644 --- a/trimsp/src/TrimSPGUI/TrimSPGUI.pl +++ b/trimsp/src/TrimSPGUI/TrimSPGUI.pl @@ -2388,6 +2388,12 @@ sub CreateInpFile my $Comp = layerTable->text($i-1,0); $All{$LComp} = $Comp; my %LElComp=Chem::parse_formula($Comp); + foreach my $key (keys %LElComp) { +# Check if composition is understood + if ($key eq "" || Chem::Zof($key) eq "") { + $Check++; + } + } if ($Comp eq "") {$Check++;} # Densities of layers @@ -2403,8 +2409,8 @@ sub CreateInpFile if ($d eq "") {$Check++;} # Sanity check, is the layer supposed to have value? are they all there? - if ($Check!=0) { - my $ErrMsg="Error: Layer $i is empty. Expecting it to be defined!\n"; + if ($Check!=0 ) { + my $ErrMsg="Error: Bad chemical formula in Layer $i.\nPleach check!\n"; print STDERR $ErrMsg; my $HelpWindow = Qt::MessageBox::information( this, "Error!",$ErrMsg); return "ERROR"; diff --git a/trimsp/src/TrimSPGUI4/TrimSPGUI4.pm b/trimsp/src/TrimSPGUI4/TrimSPGUI4.pm index 7ffc42f..8b12acb 100644 --- a/trimsp/src/TrimSPGUI4/TrimSPGUI4.pm +++ b/trimsp/src/TrimSPGUI4/TrimSPGUI4.pm @@ -363,8 +363,7 @@ sub CreateInpFile # Check if composition is understood if ($key eq "" || Chem::Zof($key) eq "") { $Check++; - } - + } } if ($Comp eq "") {$Check++;} # Write composition to results file header