Hi carnifex1992!
Not sure what you mean where is your script located. You have to invoke script every time when the slider value is changed see event onDataEditAccept :
The line in your script looks odd:
Set pMe.vars("pos")=Slider.Value
probably should be
pMe.Vars("pos").Value=Slider.Value
This is valid if you have a variable Slider with reference to PmiSlider object. If Var "pos" is in the object PmiSlider the following is better:
pMe.Vars("pos").Value=pMe.Value
Keep in mind that statement Set is uset to set a reference to object set x = y. If you want to set value You use syntax: x = y
Probably the best solution for you is:Prerequisities:
If you have somewhere a Var named by you "pos" and you have a slider and you want to have automatically write the output of slider value to your Var "pos" on change and vice versa on init you want to have slider initialised on position defined with Var "pos" (bi-directional binding)
Then:
In PmiSlider configuration page create a DBind of type GP (see
http://www.promotic.eu/en/pmdoc/EditorPan/DBinds/Cfg/DBindGP.htm) for Value:
see Example 5 or 6
This way you will have your Vars("pos") bi-directionally binded with Slider.Value.