ID:2155958
 
(See the best response by Kaiochao.)
Code:
mob
verb
StrengthUp()
set category = null
if(!Creating)
return
else
if(Points == 0)
alert("You have no more stat points to spend.")
else
Points -= 1
StrengthMod += 0.1
winset(usr, "statpanel.statpoint", "text=[Points]")
winset(usr, "statpanel.str", "text=[StrengthMod]")


Problem description:
I am trying to bring pass a variable to a procedure, rather than using separate verbs for each button. So rather than the above code, something like this (oversimplified):

mob
proc
Up(A)
Points--
A++

Best response
Buttons (and other things that take "commands") can only call verbs that the player has access to.
mob
verb
Up(SkillName as text)
set hidden = TRUE

// of course
if(Points <= 0) return

Points--
switch(SkillName)
if("strength")
StrengthMod += 0.1
if("blah")
BlahMod += BLARG

Then, you set the button's command to:
Up strength
// or
Up blah
In response to Kaiochao
Ah, that's a pain - but thanks!
You can save yourself a buttload of frustration by keeping all of your pending changes in a datum.

statchanges
var/list/changes = new

proc/Add(mob/owner, item, n)
n = round(n,1) // only allow integers
var/unused = owner.statpoints
for(var/item2 in changes) unused -= changes[item2]
. = changes[item] || 0
changes[item] = max(min(.+n, unused), 0)
if(changes[item] != .)
unused -= changes[item] - .
winset(owner, "statchange_[ckey(item)]", "text=[changes[item]]")
winset(owner, "statchange_unused", "text=[unused]")

// apply all changes
proc/Finalize(mob/owner)
var/item, n
for(item in changes)
n = min(changes[item], owner.statpoints)
winset(owner, "statchange_[ckey(item)]", "text=0")
if(n <= 0 || !owner.CanChangeStat(item)) continue
owner.vars[item] += n
owner.statpoints -= n
winset(owner, "statchange_unused", "text=[owner.statpoints]")
changes.Cut()

mob
var/statpoints = 0
var/statchanges/statchanges

verb/ChangeStat(item as text, n as num)
if(item!="strength" && item!="magic" && ...)
return // invalid stat
if(!statchanges) statchanges = new(src)
statchanges.Add(src, item, n)

verb/ApplyStats()
if(statchanges) statchanges.Finalize(src)
if(!statpoints) statchanges = null

That's sort of a rough setup, but it should give you the gist. Basically you use only one verb for all of your stat changes, and another verb to apply all those changes at once. The datum keeps track of what your current changes are.