[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lisp strings to str255
- To: info-MCL@cambridge.apple.com
- Subject: Re: lisp strings to str255
- From: sdobbs@trivia.coginst.uwf.edu (Steven Dobbs)
- Date: Tue, 25 Feb 92 10:39:36 CST
>>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".
> )
>
I tried the with-pstrs function, but I cannot get it to work. Here is the
code that I have, it anyone can help.
(defun doit ()
(rlet ((myrec :aeaddressdesc)
(mystr :str255))
(let ((openfile (choose-file-dialog)))
(with-pstrs ((mystr openfile))) ;; converts string to str255
;;(checkError (#_AECreateDesc #$typeFSS mystr (length openfile) myrec))
)))
This is supposed to get a file name and convert it to a str255 so that I
can use it in an apple event. It gets to the with-pstrs and retruns the
following error
> Error: Argument #P"Tsunami: Steve:Steve's Lisp Folder:Eliza.lisp" is not of type SEQUENCE.
> While executing: DOIT
> Type Command-. to abort.
See the Restarts menu item for further choices.
?>
Anyone got any clues?
Steven Dobbs
sdobbs@ai.uwf.edu
Institute for Human and Machine Cognition
University of West Florida
"The solution to the problem will inevitably change the problem"