Creating conditionals with FDK
Hi All;
Long time, no post. 😉
Hey, this is probably a long shot but what the heck. If you don't bet, you can't win. One of my coworkers is trying to use the FDK to generate conditional paragraphs (or other tags). He's been entirely unsuccessful despite the fact that he's following the examples given in the doc. I promised to post here just on the off-chance we can solve this, so here's his email to me......
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here’s the passage from the FDK Programmer’s Reference that holds the key to my question for the user’s group (please excuse the ugly formatting):
F_ApiSetInts() Sets an F_IntsT property.
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiSetInts(F_ObjHandleT docId,
F_ObjHandleT objId,
IntT propNum,
F_IntsT *setVal);
Arguments
F_IntsT is defined as:
FA_errno value Meaning
FE_BadDocId Invalid document ID
FE_BadObjId Invalid object ID
FE_BadName Specified name is illegal
FE_WrongProduct Current FrameMaker product doesn’t support the operation
docId The ID of the document, book, or session containing the object whose property you
want to set
objId The ID of the object whose property you want to set
propNum The property to set (for example, FP_InCond)
setVal The F_IntsT structure to which to set the property
FDK Programmer’s Reference 289
F_ApiSetInts()
2
typedef struct {
UIntT len; /* Number of IntTs */
IntT *val; /* Array of IntTs or F_ObjHandleTs */
} F_IntsT;
Returns
VoidT.
If F_ApiSetInts() fails, the API assigns one of the following values to FA_errno.
Example
The following code sets the condition for text added at the insertion point to Comment:
. . .
F_ObjHandleT docId, commentId;
F_IntsT conditionIds;
/* Get ID of Comment tag in current document. */
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
commentId = F_ApiGetNamedObject(docId, FO_CondFmt, "Comment");
conditionIds.val = (IntT*) &commentId;
conditionIds.len = 1;
/* Set document’s type-in condition property to Comment ID. */
F_ApiSetInts(FV_SessionId, docId, FP_InCond, &conditionIds);
. . .
See also
“F_ApiGetInts()” on page 130.
Basically, I have tried the example and many, many variants but, even in the best case, I get error msg:
#define FE_NameNotFound -20 /* Can't find object with requested name */
And this I get even when I have verified that the condition text “Internal” exists…
Thanks for the help,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
David Blyth (UNIX and vi Dinosaur)
Sr. Staff Technical Writer
QUALCOMM - Standard Disclaimers Apply
Only 149,999,949 more years of Ruling The Earth to go
--------------------------------------------------------------------
