Forum of trending ideas

Forum of trending ideas



SearchSearch   Users   Registration   Entrance
Today: 27.01.2026 - 02:11:02
Pages:  1  

store a variable in file for use with other script

AuthorMessage

MJockey

Newbie


Statistics:
Messages: 134
Registration: 04.10.2002
Rating:
😍😍😍😍😍
😍😍😍😍😍

Hello, I have, by copy and pasting from examples i found, tried to write a variable a into a file, to late restore it with another script. I have the feeling this could be quite handy for different tasks - eg to let a script know if a action has already been done, to set global "modes" for a number of scripts, etc. For example one script to be used to set a variable in the file to 1 or 0. Other scripts could look at that variable and show different behaviors deppending on what number they see. Below are my experiments, if you feel this should be handled differently please give me a hint - i really have no idea what i am actually doing here. With this code (adapted from the superglue scripts) i can actually create a file flags.db :) I have no idea if i am actually writing to it, opening the file in text editor shows a bunch of strange symbols... also if i try to define a = 1 and call it real, integer or number i get an error that the variable type is not supported. Only works with text like this: Code:


----------
Cars: '98 M3 Coupe - Daily Driver '98 M3 sedan - Track car:
Message # 1 03.01.23 - 20:18:11
RE: store a variable in file for use with other script

HaroldC

Newbie


Statistics:
Messages: 229
Registration: 04.04.2003
Rating:
😍😍😍😍😍
😍😍😍😍😍

Using a Sqlite database to write and read simple variable values is overkill! (And likely pretty slow too.) The Reaper API already has SetExtState, GetExtState, DeleteExtState, HasExtState, functions which allow storing and loading state data into/from an automatically managed ini-file.



Message # 2 03.01.23 - 20:25:34
RE: store a variable in file for use with other script

Sharkbite2000

Newbie


Statistics:
Messages: 236
Registration: 11.03.2002
Rating:
😍😍😍😍😍
😍😍😍😍😍

I wrote some example scripts. To store : Code:



Message # 3 03.01.23 - 20:30:25
RE: store a variable in file for use with other script

bmwpower

Newbie


Statistics:
Messages: 3,806
Registration: 08.06.2002
Rating:
😍😍😍😍😍
😍😍😍😍😍

wonderfull! I had the feeling my approach was a little unfortunate... This happens if a noob learns by copy and paste... And now i understand what those ExtState commands are about. I say thank you!



Message # 4 03.01.23 - 20:37:37
RE: store a variable in file for use with other script

neaks325i

Newbie


Statistics:
Messages: 117
Registration: 05.11.2002
Rating:
😍😍😍😍😍
😍😍😍😍😍

now i had a little time to play with this. one scenario i can imagine is using a key to toggle through a number (5 in the excample) of modes for other scripts. maybe make F1 to F12 choose custom colors, markers, track templates, fx-chain templets, inputs or outputs... stuff like that. Works nicely like that: Code:



Message # 5 03.01.23 - 20:46:05
RE: store a variable in file for use with other script
Pages:  1  

The administrator has prohibited guests from replying to messages! To register, follow the link: register


Participants

Forum engine: Exbb 2.2