Load data structures (=lists and tables) internally within a bot
Started by Anonym, Feb 09 2012 01:57 PM
6 replies to this topic
#1
Posted 09 February 2012 - 01:57 PM
Similar to that you can set the contents of a variable, I think it would be a nice feature to be able to set the contents of data structures (= lists and tables) internally within a bot WITHOUT reading files.
Reason: if I for instance distribute a bot freely, then I want to make sure that it works at all times in the ways I can control. If I have the contents of data structures in external files only, they can be altered. I am specifically thinking of things like translation tables between language and language codes, country and country codes etc. It is of course possible to store the files on my own host, but that would create a call to my host for just fetching some simple/static data.
To my knowledge this is not possible to do today.
Reason: if I for instance distribute a bot freely, then I want to make sure that it works at all times in the ways I can control. If I have the contents of data structures in external files only, they can be altered. I am specifically thinking of things like translation tables between language and language codes, country and country codes etc. It is of course possible to store the files on my own host, but that would create a call to my host for just fetching some simple/static data.
To my knowledge this is not possible to do today.
#2
Posted 09 February 2012 - 02:16 PM
It is possible now , just follow this code
Although I would like a $Table from text function, so I do not have to have many add list to table commands.
What I do sometimes is have the table in a variable , then write it to file and use the "create table from file" command. Then I would delete the file.
It works , but $Table from text will be easier.
add list to list(%Alphabet List, $list from text("A B C D E F G H I J K L M N O P Q R S T U V W X Y Z", " "), "Delete", "Global")
add list to table as column(&Alphabet Table, 0, 0, %Alphabet List)
add list to table as column(&Alphabet Table, 0, 1, %Alphabet List)
Although I would like a $Table from text function, so I do not have to have many add list to table commands.
What I do sometimes is have the table in a variable , then write it to file and use the "create table from file" command. Then I would delete the file.
It works , but $Table from text will be easier.
#3
Posted 09 February 2012 - 03:59 PM
Great! I didn't think of that!
Thanks a lot!
Thanks a lot!
#4
Posted 09 February 2012 - 04:20 PM
table from text is easy.
comma separate your values, and create table, from a variable with the set content comma delimited
comma separate your values, and create table, from a variable with the set content comma delimited
#5
Posted 09 February 2012 - 11:48 PM
table from text is easy.
comma separate your values, and create table, from a variable with the set content comma delimited
How do you do it without writing to file?
Can you give me a code example?
Thanks
#6
Posted 13 February 2012 - 06:19 AM
Yes, I wonder that too. I have tried a lot of different things now, but nothing ends up in a table.
TJ, please guide us with your wisdom.
Thanks!
TJ, please guide us with your wisdom.
Thanks!
#7
Posted 13 February 2012 - 12:02 PM
sorry would have to save to file, load it, then delete it..
by writing the temp file you can then load it into the table currently.
create table from text, or create table from list would be great.
by writing the temp file you can then load it into the table currently.
create table from text, or create table from list would be great.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users













