[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lisp strings to str255

>Is there a function in MCL that will convert a string to a str255, or
>should I just write my own?

The WITH-PSTRS macro usually suffices.

(with-pstrs ((pstr "A string"))
  ; In the body, PSTR is bound to a stack-allocated
  ; Pascal string containing "A string".

If you need to copy into a Mac heap allocated str255, macro-expanding
a WITH-PSTRS form will reveal an internal function that will do what
you want in this case (officially, I suggest that you don't use unexported