ID:1119506
 
Keywords: datum, error, null, proc, return
(See the best response by Jemai1.)
Code:
keygen
var/list
validChar = list( "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z" )
validNum = list("1","2","3","4","5","6","7","8","9","0")

proc/getRChar()
var/tmp/randChar = pick("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z" )
return randChar

proc/getRNum()
var/tmp/randNum = pick("1","2","3","4","5","6","7","8","9","0")
return randNum



mob
proc/keygen/getRChar()
proc/keygen/getRNum()
New()
..()
world << "char = [getRChar()]</br>num = [getRNum()]"



Problem description:
No debug errors
mob/proc/keygen/getRChar() returns null
mob/proc/keygen/getRNum() returns null

As described, i can't get keygen/proc/ to work? What am i missing here?

btw, how can i make the keygen/proc to pick from var/list/valid---- ?
Best response
var/keygen/keygen = new
mob
//proc/keygen/getRChar() // you can't do these
//proc/keygen/getRNum()
New()
..()
world << "char = [keygen.getRChar()]</br>num = [keygen.getRNum()]"
okay, been a time since i programmed soo xD Never was any good with creating new datums. Thanks :)
Oh and for picking from the valid list, you can do it like this
proc/getRChar()
return pick(validChar)

proc/getRNum()
return pick(validNum)
hahaha...! The simplicity!