Re: Module command acting funny...
- To: mathgroup at smc.vnet.net
- Subject: [mg58268] Re: Module command acting funny...
- From: Peter Pein <petsie at dordos.net>
- Date: Sat, 25 Jun 2005 01:56:26 -0400 (EDT)
- References: <d9gb7c$svs$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
plizak schrieb:
> computeIndividualCDOPLB[ filteredTimes ] := Module[
> {i},
> Print[ "computing IndividualCDOPLB"];
> ];
>
> mathcode(A1:A6), result is NULL (which means no errors).
>
> But when I call this module, it doesn't run (i.e. the output is not
> printed.
>
> When I remove the semicolon at the end of the print statement, it
> works! Until I recompile it again and then it doesn't work until I add
> the semicolon back in. I then just kept the semicolon in and changed
> the text to print (adding spaces), and it won't run the first time,
> only after I've modified it will it run.
>
> Any idea why this is the case? I don't want my end users having to
> modify the code sheets after linking to mathematica.
>
> I normally would have more code in this module, but I stripped it all
> out and it still acts funny.
>
> Any ideas why this is the case? Am I using Module[ ] properly? Should
> I use Block[ ] or With[ ] instead? Maybe another technique?
>
> Thanks,
> Peter
>
Hi Peter,
you forgot the Blank:
In[1]:=computeIndividualCDOPLB[filteredTimes] :=
Module[{i}, Print["computing IndividualCDOPLB"]; ];
In[2]:=computeIndividualCDOPLB[foo]
Out[2]=computeIndividualCDOPLB[foo]
In[3]:=Clear[computeIndividualCDOPLB];
computeIndividualCDOPLB[withAnArgument_] :=
Module[{i}, Print["computing IndividualCDOPLB"]; ];
In[4]:=computeIndividualCDOPLB[bar]
From In[4]:="computing IndividualCDOPLB"
--
Peter Pein
Berlin