Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I would like to convert String to Number. I tried this but is wrong
ActiveDocument.GetVariable("Evolution").GetContent.Number
ActiveDocument.GetVariable("Evolution").GetContent.Int
Is there somewhere i can find manual of API VBScript?
Thanks
Use VB syntax:
CInt(ActiveDocument.GetVariable("Evolution").GetContent.String) 'Convert to Int
CLng(ActiveDocument.GetVariable("Evolution").GetContent.String) 'Convert to Long Int
CDbl(ActiveDocument.GetVariable("Evolution").GetContent.String) 'Convert to Double (Decimal)
I suspect that you could also use evaluate to do the conversion in QlikView:
ActiveDocument.Evaluate("num(Evolution)")
I could easily have the wrong systax, or simply be wrong. But in general, I try to do as much as I can with QlikView, and as little as I can with Visual Basic. Part of that is that I'm a long way from being a Visual Basic expert. But I also reason that all QlikView developers will understand QlikView expressions, but only some of them will have a good grasp of Visual Basic expressions. So using as much QlikView as possible seems better to me from a maintenance perspective.