|
francis.favorini
Forum Admin
    
USA
618 Posts |
Posted - Apr 16 2003 : 6:08:05 PM
|
Folks,
If you have source code or other text that you want formatted exactly as entered, you should use [code][/code] tags around it. This will preserve whitespace and line breaks exactly as they are. Long lines will not be broken.
The way you use these tags is similar to HTML. Place the text you want to be formatted in between the opening and closing tags. Like this: [code]Text to be formatted[/code]
You can type the tags along with the text of your post or you can use the formatting buttons. Just select your text and click the button. When editing your post, you can change the Format Mode setting from Basic to Help or Prompt. Then click on one of the Format buttons for help or to be prompted for the formatting options.
There is a section in the FAQ which enumerates the formatting tags you can use. There is also a Forum Code link above the smilies on the posting page which has the same info.
Example without code tags
if (strncmp(P(end-2:end),'img',3) & exist(P2,'file')) | ... strncmp(P(end-2:end),'hdr',3) [DIM,VOX,SCALE,TYPE,OFFSET,ORIGIN,DESCRIP] = spm_hread(P); else V = readmrtest(P,'=>INFOONLY'); if ~isempty(V) DIM = [getfield(V.info.dimensions,{1},'size'),... getfield(V.info.dimensions,{2},'size'),... getfield(V.info.dimensions,{3},'size')]; else error(sprintf('Error reading %s.',P)); global DIM VOX SCALE TYPE OFFSET ORIGIN DESCRIP = ['defaults']; end end
Example with code tags
if (strncmp(P(end-2:end),'img',3) & exist(P2,'file')) | ...
strncmp(P(end-2:end),'hdr',3)
[DIM,VOX,SCALE,TYPE,OFFSET,ORIGIN,DESCRIP] = spm_hread(P);
else
V = readmrtest(P,'=>INFOONLY');
if ~isempty(V)
DIM = [getfield(V.info.dimensions,{1},'size'),...
getfield(V.info.dimensions,{2},'size'),...
getfield(V.info.dimensions,{3},'size')];
else
error(sprintf('Error reading %s.',P));
global DIM VOX SCALE TYPE OFFSET ORIGIN
DESCRIP = ['defaults'];
end
end
-Francis
|
IT Director, Brain Imaging and Analysis Center |
|