View Single Post
Old 23rd April 2021, 16:46   #25  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Doggy, can you supply a short testclip and client script, thanks.
[I've found your ResizersPack4.7.4.avsi]

EDIT: As a very temporary hack for global survival, you could use RT_Stats DBase or array,
and preset fields/elements with eg -1, not set. Then you only need to use a fixed DBase name
to read or write, vars can even survive a reboot.

EDIT:
Code:
DB = "My.DB".RT_GetFullPathName

X1_FLD = 0
Y1_FLD = 1
X2_FLD = 2
Y2_FLD = 3

RECORD_0 = 0

TypeString="iiii"   # 4 fields of type int

RT_DBaseAlloc(DB,1,TypeString)   # Single pre-existing record [int field defaults are set to 0]

RT_DBaseSet(DB,RECORD_0,-1,-1,-1,-1)    # PreSet all vars -1

X1 = RT_DBaseGetField(DB, RECORD_0, X1_FLD)
Y1 = RT_DBaseGetField(DB, RECORD_0, Y1_FLD)
X2 = RT_DBaseGetField(DB, RECORD_0, X2_FLD)
Y2 = RT_DBaseGetField(DB, RECORD_0, Y2_FLD)


# ...

RT_DBaseSetField(DB, RECORD_0, X1_FLD, X1)
RT_DBaseSetField(DB, RECORD_0, Y1_FLD, Y1)
RT_DBaseSetField(DB, RECORD_0, X2_FLD, X2)
RT_DBaseSetField(DB, RECORD_0, Y2_FLD, Y2)

# OR

RT_DBaseSet(DB, RECORD_0, X1,Y1,X2,Y2)
EDIT: Even though file based, DBase is fast from harddrive, certainly faster than Global access on v2.60, not sure about Avs+ as
Avs+ implemented hash table for Globals access.

EDIT: DBase is also a way to return multiple results from a function, supply the function with DBase name, and function
returns results in DB, with perhaps success status as actual function return.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 23rd April 2021 at 17:19.
StainlessS is offline   Reply With Quote