# Another question about DrawFormattedText

**URL:** <https://psychtoolbox.discourse.group/t/another-question-about-drawformattedtext/392>\
**Category:** Uncategorized\
**Created:** [November 21, 2012, 2:41pm UTC](https://psychtoolbox.discourse.group/t/another-question-about-drawformattedtext/392 "2012-11-21T14:41:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![emiliecaspar](https://avatars.discourse-cdn.com/v4/letter/e/aca169/32.png) [@emiliecaspar](https://psychtoolbox.discourse.group/u/emiliecaspar)\
**Post date:** [November 21, 2012, 2:41pm UTC](https://psychtoolbox.discourse.group/t/another-question-about-drawformattedtext/392/1 "2012-11-21T14:41:03Z")

</div>

Hello,  
  
I wrote this script :   
  
SsID = input ('Numero participant: ','s');   
[w, wrect]=Screen('OpenWindow', 0);  
[width, height]=Screen('WindowSize', w);   
  
items = {'lapin', 'souris', 'voiture', 'saumon', 'vélo', 'table', 'cochon'};  
Order=items(randi(length(items)):end)  
  
for i = Order   
 Screen(w, 'TextFont', 'Calibri')  
 Screen(w, 'TextSize', 50)  
 DrawFormattedText(w, items, 'center', 'center', [54,54,54])   
 Screen(w, 'Flip')  
 WaitSecs(2)   
end  
  
Screen('CloseAll');  
  
DrawFormettedText functions if I don't use the command 'items(randi(length(items)):end)'  
But with this one, I have this error message :  
  
??? Error using ==\> strfind  
Input strings must have one row.  
  
Error in ==\> DrawFormattedText at 136  
newlinepos = strfind(char(tstring), '\n');  
  
Error in ==\> EssaiRandint at 19  
 DrawFormattedText(w, items, 'center', 'center', [54,54,54])  
  
I have looked at forums, DrawFormetedTextdemo, etc, but without succes.  
I dont understand the error, and that would be very nice if somebody can help me.
