PA_GetTrueTableNumber

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

version 2003


PA_GetTrueTableNumber (trueNb) short

ParameterTypeDescription
trueNbshortvirtualNb

Description

Given a virtual table number, the command PA_GetTrueTableNumber returns the true table number. It is the number in the real structure, the one that is defined in the Design environment.

If you want to call API routines that use table numbers, be sure to switch between virtual/real structure if necessary, depending of what you want to do.

The virtual structure is used when the 4D commands SET TABLE TITLES and SET FIELD TITLES are called.

Example

Using a hidden table and a visible table in the same block of code.

   short DoSomethingWithThisTable(short virtualTable)
   {
   // Each time an error occurs, we immediately call return with this error
      short   trueTable;

   // fVirtualIsOK is a global char variable, initialized at startup
   // by calling PA_VirtualStructuredUsed
      if(! fVirtualIsOK)
         return MY_ERROR_VS;

   // OK, virtual structure is supported, we can work
   // First, get the number of the virtual table in real mode
      trueTable = PA_GetTrueTableNumber(virtualTable);

   // -------------- Start to work
   // Load the current record of the specified table
      PA_LoadRecord(trueTable);
      if(PA_GetLastError())
         return PA_GetLastError();
   // if no error, load the record of my hidden table
   // (for this sample, we defined in a macro kMY_SPECIAL_TABLE)
      PA_LoadRecord(kMY_SPECIAL_TABLE)
      if(PA_GetLastError())
         return PA_GetLastError();
   // OK, both records are loaded, do something with them
      . . .

      return PA_GetLastError();
   }

See Also

PA_GetVirtualTableNumber.

Error Handling

PA_GetLastError always returns eER_NoErr


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