Mathematica 9 is now available
Student Support Forum
Student Support Forum: 'Getting an expression rather than value' topicStudent Support Forum > General > "Getting an expression rather than value"

Help | Reply To Topic
Author Comment/Response
Humphrey Drummond
09/19/07 06:24am

I wonder if anyone can help me with this. I am creating a test function to test code and want to add the source of the expression t to a list so that at the end of the evaluation I can see a complete list of all the test cases that didn't work. However i have tried holdForm but still get t= False rather than say

giving me a testResult to {1==2}

TestResult = {};

NotOK[t_] :=
Style["Problem with test->" <> ToString[t], FontColor -> Red, Bold];

OK = Style["Check ok", FontColor -> Green];

Test[b_] := If[b,
TestResult = Append[TestResult, HoldForm[b]];
NotOK[ ToString[HoldForm[b]]]

URL: ,
Help | Reply To Topic