lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


win10 64 5.1 (family historian 6 user)
I am an intermediate novice lua guy.

if any of you program rpg/ile on an iseries you will understand this completely.

otherwise, in lua terms I have a gridbox, and I want to read changes from the gridbox, and return to the client program, insofar as I can see, there is no shortcut way to indicate changes but I must read the entire gridbox and programmatically stare and compare returned fields against the table brought in or a internal table that saves the original loaded table values.

as of this instant, I am prototyping and hard coding some names for variables etc, but hopefully the idea you get is that I have one row on the gridbox.  it must contain a key (I will worry about keys I do not want to display in the gridbox later.


here is what I have so far to read changed records...

 local function sfl_readc()

  for s = 1, qwcsfl.numlin do
    local sfl_lin = iup.GetChild(qwcsfl, ((s - 1) * qwcsfl.numdiv)) -- sfl.elem
    local KEY = sfl_lin.title
  
    --[[
    ? do #fldbuf - 3
    for k, v in pairs(fldbuf) do
      the code cycle
    end
    ]]

    -- repeat for 3 to qwcsfl.numdiv
    -- obj[s] = either sfl_lin or obj[s - 1]
    local ctx = iup.GetBrother(sfl_lin)
   local val = iup.GetBrother(ctx)
  end for s=1
end -- fn sfl_readc
I am trying to find a way to fix it so that after key or even at key, I can (if you will substring the spc_lin in a more general format, so that I can loop it something like
for s = 1 to numdiv do
obj[s] =  iup.GetBrother(????) -- how to make the offset to the current(''field' table)
I know the layout is
Key(variable len and data)
Var[2] (variable len and data)(which is not available as *next or something to get offset)
...
Var[numdiv]
end loop

I hope I have made myself clear regarding what I want, I do not know all the modern programming nomenclature for these things, and from what I have read on this list, you all have me at a disadvantage in explaining and knowledge of this.  In any case, thank you.