12.02.2020, 12:51
Hi All,
I'm trying to find a user parameter via a keywork (tag) search rather than the parameter name much like I can do it with other types. I've looked at running a sql query in a function to do it however I can't seem to associate a keyword with the parameter name.
I can use:
SetUserParam('Local Network', 'w_obs_wind_dirtext', value)
however I want to set the value based on the keywork like
SetCBusByKW({'irrigation_current_runtype'}, 'or', {target = 1, ramprate = 0})
I have some db helper functions like the below, so not opposed to doing something in a query.
function db_GetObjectByTag(tag)
-- Return a table of object parameters based on the id
local query = string.format('SELECT * FROM objecttags WHERE tag = "%s"', tag)
liste = db:getall(query)
if (table.maxn(liste) ~= 0) then
return liste
else
return false
end
end
Cheers,
Paul
I'm trying to find a user parameter via a keywork (tag) search rather than the parameter name much like I can do it with other types. I've looked at running a sql query in a function to do it however I can't seem to associate a keyword with the parameter name.
I can use:
SetUserParam('Local Network', 'w_obs_wind_dirtext', value)
however I want to set the value based on the keywork like
SetCBusByKW({'irrigation_current_runtype'}, 'or', {target = 1, ramprate = 0})
I have some db helper functions like the below, so not opposed to doing something in a query.
function db_GetObjectByTag(tag)
-- Return a table of object parameters based on the id
local query = string.format('SELECT * FROM objecttags WHERE tag = "%s"', tag)
liste = db:getall(query)
if (table.maxn(liste) ~= 0) then
return liste
else
return false
end
end
Cheers,
Paul