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

PInterface & _TruncString

I'm having trouble with running PInterface Translator on the TextUtils.p
interface file.  Actually, I've never been able to successfully convert new
interface files using this utility, this is only the latest attempt.  The
#'translate function never makes it through a file without breaking into the
debugger....  Are there any hints or tidbits anyone can share that may help me
out here?
On a related topic, I'm trying to define a trap for #_TruncString (which is in
the TextUtils.p file, which I don't have).  The only things I'm sure of in the
deftrap statement is the parameter order and the trap codes; the rest has been
created by modeling other portions of the interface files.  Here is one
(defconstant $truncEnd  0 "Truncate at end")
(defconstant $truncMiddle #x4000 "Truncate in middle")
(traps::def-mactype :TruncCode (find-mactype :integer))
(traps::deftrap _TruncString ((width :integer) (theString (:string 255))
                              (truncWhere :TruncCode))
                (:stack :integer)
                (:stack-trap #xA8B5 :d0 #x8208FFE0 width theString truncWhere))
(defun test (string width &optional (where $truncEnd))
  (when (and (stringp string) (numberp width))
    (with-pstrs ((s string))
      (let ((result (#_TruncString width s where)))
        (format t "~%Result: '~A'" result)
        (format t "~%String: '~A'" (%get-string s))
Unfortunately this *never* seems to truncate the string:
? (test "Macintosh" 10)  ; 10 = width in pixels
Result: '0'              ; Meaning "No truncation necessary"
String: 'Macintosh'
Thoughts?  Ideas?