PA_SetTextField

4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next

version 2003


PA_SetTextField (tNum; fNum; text; len)

ParameterTypeDescription
tNumshortTable number of the field to access
fNumshortField number of the field to access
textchar*Pointer to the text buffer
lenlongLength of the text

Description

The routine PA_SetTextField fills the text field number fNum of the current record of the table number tNum with the text pointed to by the buffer text, of length len.

If the field is not a text field, the routine does nothing and sets an error in PA_GetLastError().

Depending on default settings or on previous calls to PA_UseMacCharacters or PA_UseANSICharacters, newText should contain Macintosh or ANSI characters.

Example

Fill the field content with the content of a text variable (no error checking here).

   void TextVariableToTextField( PA_Variable v, short tNum, short fNum )
   {
      char   *text;
      long   size;

      if(PA_GetVariableKind(v) == eVK_Text)
      {
   // First get the size of the buffer, then allocate it and recall the routine
         size = PA_GetTextVariable( v, 0 );
         text = malloc( size );
         size = PA_GetTextVariable( v, text );

   // text is filled -> transfert it to the field
         PA_SetTextField( tNum, fNum, text, size );

   // cleanup
         free(text);
      }
   }
   

See Also

PA_GetTextField, PA_UseAnsiCharacters, PA_UseMacCharacters.

Error Handling

Use PA_GetLastError to see if an error occurred


4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next