From the ModelSim SE Command Ref manual : The force command allows you to apply stimulus interactively to VHDL signals and Verilog nets. Since force commands (like all commands) can be included in a macro file, it is possible to create complex sequences of stimuli.
Alternatively a force can also be applied from the ModelSim/Questa GUI. Just right click on the signal/net and you should be able to find the 'Force' option (or something very similar to this process; currently I am not running ModelSim/Questa).
However for a variable, 'force' will not work. Variables cannot be forced to a new value. If you want to change the value of a variable, you need to use the command change.