At 08:05 PM 6/30/97 +0200, Harrie wrote: >So ... MSWLOGO > SWLOG > WLO > L > >I write the following procedure > >to remove :wrd >if emptyp :wrd [stop] >print :wrd >remove bf bl :wrd >end > >When the procedure gets to the last letter (L), I get a error message >" .... Logo doesn't like [] as an input for bf .... ". >I understand the error. But how do I fix it? > Try this: to r2 :wrd if emptyp :wrd [stop] print :wrd ifelse greaterp count :wrd 1 [r2 bf bl :wrd] [r2 bf :wrd] end Not very eloquent, but it gets the job done. The ifelse keeps you from taking one too many characters from the string. Regards, Tom --------------------------------------------------------------- Please post messages to the Logo forum to logo-l@gsn.org. Mail questions about the list administration to logofdn@gsn.org. To unsubscribe send unsubscribe logo-l to majordomo@gsn.org.
Global SchoolNet Foundation -
Linking Kids Around the World!
Copyright GSN - All Rights Reserved
- Comments
& Questions
Visit GSN's
Global
Schoolhouse for more exciting learning resources!
Search our Site
-
Home