Well you cannot create types at runtime.
type
VariantKind = enum
vkString
vkInt
VariantType = object
case kind: VariantKind
of vkString:
strValue: string
of vkInt:
intValue: int
proc getArg(typeName:string, strValue:string): VariantType =
case typeName:
of "string":
result.kind = vkString
result.strValue = strValue
of "int":
result.kind = vkInt
result.intValue = parseInt(strValue)
else:
# do some error handling
discard
- Dynamic Types geekboy
- Re: Dynamic Types mashingan
- Re: Dynamic Types andrea
- Re: Dynamic Types Krux02
- Re: Dynamic Types Arrrrrrrrr
- Re: Dynamic Types geekboy
