1lytics

Inputs/Outputs information

gkGetNumberOfInputs

The gkGetNumberOfInputs function returns number of input variables in logic function system.

numInputs = gkGetNumberOfInputs()

Usage sample

See gkGetInputName function sample.

gkGetNumberOfFunctions

The gkGetNumberOfFunctions function returns number of functions in logic function system.

numFunctions = gkGetNumberOfFunctions()

Usage sample

See gkGetFunctionName function sample.

gkGetMaxInputVector

The gkGetMaxInputVector function returns maximum value of truth table input vector. Returned value is equal to 2N-1, where N is number of inputs, reurned by gkGetNumberOfInputs().

MaxInput = gkGetMaxInputVector()

Usage sample

gkAddInputVar('x', 3)
gkAddFunction('y', 2)
MaxInput = gkGetMaxInputVector()
-- MaxInput equals to 23-1 = 7
for InputVector = 0, MaxInput do
  -- do job
  gkMessageBox("info", 'Input vector: ' .. InputVector)
end

gkGetInputName

The gkGetInputName function returns input variable name by it's index (from left to righ).

InputName = gkGetInputName(idx)

Parameters

  • idx - index of input variable, which name is required.

Usage sample

gkAddInputVar('x', 4)
gkAddFunction('y', 3)
MaxInputIndex = gkGetNumberOfInputs() - 1
for InputIndex = 0, MaxInputIndex do
    InputName = gkGetInputName(InputIndex)
    gkMessageBox("info", 'Input[' .. InputIndex ..']: ' .. InputName)
end

gkGetFunctionName

The gkGetFunctionName function returns function name by it's index (from left to righ).

FnName = gkGetFunctionName(idx)

Parameters

  • idx - index of function, which name is required.

Usage sample

gkAddInputVar('x', 4)
gkAddFunction('y', 3)
MaxFunctionIndex = gkGetNumberOfFunctions() - 1
for FunctionIndex = 0, MaxFunctionIndex do
    FnName = gkGetFunctionName(FunctionIndex)
    gkMessageBox("info", 'Function[' .. FunctionIndex ..']: ' .. FnName)
end