1
$\begingroup$

Off[FinancialData::notent] fails on first run but works thereafter. So what good is it in this case? Is there a trick to force first time success? I've tried "tricks" to my wit's end!

$\endgroup$
  • $\begingroup$ Closers: please leave this question open. The question may not be clear to everybody, but combined with the answer I find this a useful contribution to the site. $\endgroup$ – Sjoerd C. de Vries Nov 2 '14 at 12:45
4
$\begingroup$

Clearing Attributes and looking at the definition of the FinancialData reveals that it is just a stub that loads the corresponding paclet on the first evaluation:

ClearAttributes[FinancialData, {Protected, ReadProtected}]
FullDefinition@FinancialData
FinancialData := 
 System`Dump`AutoLoad[Hold[FinancialData], 
   Hold[$FinancialDataSource, FinancialData], 
   "DataPaclets`FinancialData`"] /; System`Dump`TestLoad

As you see from the definition, FinancialData initially has no Messages defined, so you cannot switch them off.

For getting Off[FinancialData::notent] working you should preload the FinancialData paclet (may be there is an easier way to do this, I do not know):

FinancialData[]; Off[FinancialData::notent]

Now it works as expected:

FinancialData::notent
$Off["`1` is not a known entity, class, or tag for `2`. Use `2`[] for a list of entities."]
FinancialData["BMW"]
FinancialData["BMW"]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.