2.5.3.20. build_CreateVTable()

[<<<] [>>>]

When the binary code of the BASIC program is saved to disk the symbol table of the user defined functions and the symbol table of global variables is also saved. This may be needed by some applications that embed ScriptBasic and want to call specific function or alter global variables of a given name from the embedding C code. To do this they need the serial number of the global variable or the entry point of the function. Therefore ScriptBasic v1.0b20 and later can save these two tables into the binary code.

The format of the tables is simple optimized for space and for simplicity of generation. They are stored first in a memory chunk and then written to disk just as a series of bytes.

The format is

long      serial number of variable or entry point of the function
zchar     zero character terminated symbol

This is easy to save and to load. Searching for it is a bit slow. Embedding applications usually have to search for the values only once, store it in their local variable and use the value.

The function @xref{build_CreateFTable()} converts the symbol table of user defined function collected by symbolic analysis into a single memory chunk.

The same way CreateVTable converts the symbol table of global variables collected by symbolic analysis into a single memory chunk.

int build_CreateVTable(pBuildObject pBuild
  ){

[<<<] [>>>]