(FILECREATED " 1-Nov-86 23:09:24" {QV}<NOTECARDS>1.3K>NEXT>RHTPATCH132.;1 4358 changes to: (MACROS NC.GetCardTypeField) (VARS RHTPATCH132COMS)) (* Copyright (c) 1986 by Xerox Corporation. All rights reserved.) (PRETTYCOMPRINT RHTPATCH132COMS) (RPAQQ RHTPATCH132COMS ((* * Fixes bug #254: break when fetching card type fields of the NoteCard card type.) (* * Change to NCTYPESMECH) (MACROS NC.GetCardTypeField) (* * Note that somehow the functions that call this macro should be recompiled. These include for example, NCP.CardTypeFn and NCP.CardTypeVar.))) (* * Fixes bug #254: break when fetching card type fields of the NoteCard card type.) (* * Change to NCTYPESMECH) (DECLARE: EVAL@COMPILE (DEFMACRO NC.GetCardTypeField (FieldName CardTypeNameForm) (* * Fetch the card type datatype field passed directly for FieldName (for the card type whose name is in a variable passed as the second parameter)) (* * rht 4/11/86: Was trying to autoload if field of card type was nil. Now only tries to autoload if CardTypeRecord is nil or if StubFlg is non-nil.) (* * fgh 4/25/86 Fix to above fix. Checks for CardTypeRecord before doing fetch's in 2 cluase of COND.) (* * kirk&fgh 26Jun86 Added check for InheritedFlg to above fix. Changed to a DEFMACRO) (* * fgh 8/26/86 Revamped completely to clean up and to account for case where one of supertypes is a stub and must be autoloaded. Added ability to handle \\EMPTY// fields.) (* * kirk 8/26/86 Added check for FMEMB of FieldName in (RECORDFIELDNAMES (QUOTE NoteCardTYpe)) before evaling fetch) (* * rht 11/1/86: Added check for NIL CardTypeName. Also checks whether card is top level NoteCard type before fetching from super type.) (BQUOTE (LET ((CardTypeName , CardTypeNameForm) CardTypeRecord) (COND ((NULL CardTypeName) NIL) ((AND (SETQ CardTypeRecord (NC.CardTypeRecord CardTypeName)) (NEQ (fetch (NoteCardType , FieldName) of CardTypeRecord) (QUOTE \\EMPTY//))) (* * card type record exists and specified field has a value -- return it.) (fetch (NoteCardType , FieldName) of CardTypeRecord)) ((OR (NULL CardTypeRecord) (fetch (NoteCardType StubFlg) of CardTypeRecord)) (* * either the card type record doesn't exist or its just a stub -- either way it needs to be autoloaded.) (if (NC.AutoLoadCardType CardTypeName (QUOTE , FieldName) (AND CardTypeRecord (fetch (NoteCardType FullDefinitionFile) of CardTypeRecord))) then (fetch (NoteCardType , FieldName) of (NC.CardTypeRecord CardTypeName)) else (NC.ReportError NIL (CONCAT "Unknown note card type: " CardTypeName " or card type field name: " (QUOTE , FieldName))))) (, (AND (FMEMB (PACK* FieldName (QUOTE InheritedFlg)) (RECORDFIELDNAMES (QUOTE NoteCardType))) (LIST (QUOTE fetch) (LIST (QUOTE NoteCardType) (PACK* FieldName (QUOTE InheritedFlg))) (QUOTE of) (QUOTE CardTypeRecord))) (* * card type record exists and is not a stub, but specified field is \\EMPTY//. And this field can be inherited. Must be that someone on the supertypes chain is a stub. Rectify the situation by fetching the field from the supertype, if any. Unfortunately direct recursion is not possible because this is a DEFMACRO.) (if (EQ CardTypeName (QUOTE NoteCard)) then (QUOTE \\EMPTY//) else (NC.GetCardTypeFieldOfSuper CardTypeName (QUOTE , FieldName)))) (T (* * card type record exists and is not a stub, but specified field is \\EMPTY//. And this field can NOT be inherited. Thus, this record is underspecified. Signal the error.) (NC.ReportError NIL (CONCAT "Non-inheritable field not specified for card type " CardTypeName))))))) ) (* * Note that somehow the functions that call this macro should be recompiled. These include for example, NCP.CardTypeFn and NCP.CardTypeVar.) (PUTPROPS RHTPATCH132 COPYRIGHT ("Xerox Corporation" 1986)) (DECLARE: DONTCOPY (FILEMAP (NIL))) STOP