Hi all, I tried a lot but can't find. How can i use table inside a type ?. This 
is failed attempt. 
    
    
    import tables
    type
        Person = ref object
            name : string
            age : int
            jobSal : Table[string, int] # tell me how to declare
    
    
    proc newPerson() : Person =
        result = new Person
        result.name = "A Name"
        result.age = 50
        result.jobSal = ["A Job" , 35000].toTable  # And tell me how to 
initialize it.
    
    proc print(me : Person) =
        echo "Person Name = ", me.name
        echo "Person age = ", me.age
       # echo "Person Job = ", me.jobSal[]      # And also tell me how to get 
the value
       # echo "Person Salary  = ", me.jobSal[]
    
    
    Run

Reply via email to