If you want to call the function you can make use of the global frame name and slash commands.

lua Code:

--CALL

localfunction SlashCmd(cmd)

if(cmd:match"unlock")then

myFrame.unlock(myFrame)

elseif(cmd:match"lock")then

myFrame.lock(myFrame)

elseif(cmd:match"reset")then

myFrame.reset(myFrame)

end

end

SlashCmdList["mymod"]= SlashCmd;

SLASH_mymod1 ="/mymod";

The most important part is that the drag function gets called on code init. It must not be called on events like PLAYER_LOGIN. That will reset the values that Blizzard read from the layout-local.txt file.