Now there is a function in the DM language that can get rid of the whitespace and misc characters (non letters) and then you can go something like;
if(src.name==null)
src<<alert("You have to write something before hitting enter!")
//back to the naming section
else
src.name=src.original_name
//continue
Anyone mind telling me what function I am describing?
A close built-in instruction is cKey(), though it may strip more than you want. People usually use a custom proc for cases like these, to strip only the characters they want stripped.
Also (tho perhaps you might not have done it in actual code), do note when working with strings*, comparing to null won't really work for you at all. If the sting is empty, its value would be "", which is distinct from null, and so a comparison between them would evaluate false. This is also related to what is called 'boolean checking'; when checking for true or false values, you should do exactly that by just specifying the expression (e.g. var) with no comparison operator - since that's exactly what the if() statement does. You should only use the comparison operator if you need to compare to a specific value.
As you probably know, the ! operator is used to 'reverse/flip' true-false values, so you can use it to check if a value is not true.
(*: It actually probably wouldn't work with generally any type of value except objects, and that's because of a "luck" effect since DM specifically sets object vars to null when they're deleted.)