Jayme McColgan Posted September 14, 2022 Share Posted September 14, 2022 I'm looking for a way to store basically a log in one of my PIO objects. what is the max length of characters i can have in a hidden parameter? is there a better place to store it that would be linked to the PIO instance no matter what user/computer has the drawing open. Quote Link to comment
twk Posted September 14, 2022 Share Posted September 14, 2022 (edited) The last time I tried it was 32767, something to do with Int types or LongInt, I can't remember. I've in the past used a splitter command and had 3 params set aside for storing data eg (storeParam1, storeParam2). code below is an example of how it would go # Split every_length x characters def value_splitter(listparams:list, value_to_store): """ listparams is List of record/plugin | field/parameter names """ val_str = str(value_to_store) max_char_length = 32767 val_params = [val_str[i: i + max_char_length] for i in range(0, len(val_str), max_char_length)] if len(val_params) <= len(listparams): for i, x in enumerate(listparams): vs.SetRField(plugin_handle, record, x, val_params[i]) else: raise ValueError("Number of parameters too few for splitter") A while back, VW introduced the use of ObjectUUIDs. You could try storing these in a json file together with the rest of the other data you're wanting to store. Edited September 14, 2022 by twk Quote Link to comment
Jayme McColgan Posted September 14, 2022 Author Share Posted September 14, 2022 17 hours ago, twk said: The last time I tried it was 32767, something to do with Int types or LongInt, I can't remember. I've in the past used a splitter command and had 3 params set aside for storing data eg (storeParam1, storeParam2). code below is an example of how it would go # Split every_length x characters def value_splitter(listparams:list, value_to_store): """ listparams is List of record/plugin | field/parameter names """ val_str = str(value_to_store) max_char_length = 32767 val_params = [val_str[i: i + max_char_length] for i in range(0, len(val_str), max_char_length)] if len(val_params) <= len(listparams): for i, x in enumerate(listparams): vs.SetRField(plugin_handle, record, x, val_params[i]) else: raise ValueError("Number of parameters too few for splitter") A while back, VW introduced the use of ObjectUUIDs. You could try storing these in a json file together with the rest of the other data you're wanting to store. ill have to give this a try. ideally i want to store it in a json format in the field. i think i could be fine with 32767 characters. i could also have it delete older data as it fills up. ill report back with what i come up with. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.