grp.create() - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: grp.create() (/showthread.php?tid=5229) |
grp.create() - tomnord - 02.02.2024 I'm trying to figure out how to generate a series of viritual adresses. example: room_nr = {name=, datatype=, } functions = etc... I want GA's to be named something like this: "room_nr""function" i guess I need a for loop, based on room_nr, but how do I separate the different roomnumbers in the table? It's most likely easy, brain is in weekend mode RE: grp.create() - admin - 02.02.2024 Use this as a starting point: Code: for i = 1, 10 do RE: grp.create() - tomnord - 12.02.2024 What is the best way, when using grp.create, to check if the GA is allready created? I'm thinking of making a dynamic script, so that when I add new GA's and tag them correctly the script will generate new virtual GA's. RE: grp.create() - admin - 12.02.2024 You can use grp.find(). RE: grp.create() - tomnord - 12.02.2024 Regarding this, and the funcion string.gsub() my pattern is '_PV' but i also have some GA's named '_PV3'. is there any way to make this function to apply only with _PV and not _PV3? RE: grp.create() - admin - 12.02.2024 If your string ends with _PV then you can use _PV$ regular expression. See this for more info: https://www.lua.org/manual/5.1/manual.html#5.4.1 RE: grp.create() - fleeceable - 12.02.2024 (12.02.2024, 08:20)tomnord Wrote: What is the best way, when using grp.create, to check if the GA is allready created? I'm thinking of making a dynamic script, so that when I add new GA's and tag them correctly the script will generate new virtual GA's. I use function block like this when automatically generating addresses in my programs... Code: --**********CREATE GROUP ADDRESSES****************** User script (HEATING_config): Code: Main_GA = '33' Scheduled/Resident/Event script: Code: require('user.HEATING_config') Hope this helps... RE: grp.create() - tomnord - 12.02.2024 Thanks guys. I'll do some testing RE: grp.create() - victor.back - 12.04.2024 Hi I have a function in a script for creating the necessarily groupadresses. But in this script it´s not creating the adresses, can I ask if someone can see what can be the issue? Code: -- Skapa nödvändiga gruppadresser RE: grp.create() - admin - 13.04.2024 datatype field should be either dt.text (without quotes) or 'text' RE: grp.create() - victor.back - 13.04.2024 (13.04.2024, 08:44)admin Wrote: datatype field should be either dt.text (without quotes) or 'text' Thanks! That solved it... |