If you can right down the algorithm to do the conversion, then I'm sure boo can handle it.
Not able to use Power function in calculation and also for loop iteration is also creating issues. Can you help me solving the issue?
I'm afraid I don't understand what you are trying to do, so no, I don't think I can help at the moment. Why don't you start by describing what you are trying to implement? boo is quite similar to python so you could start by researching boo from the link shown below and python from all sorts of places on the web.
I have a number in Base36 format (for example: 3FDPO56). I have to convert it to Base10 using calculations. Base10 conversion of 3FDPO56 is 7460372346.
This is what i need to achieve through calculations. Is it possible to do so in landesk service desk?
Thank you. Your reply is much appreciated.
I am not able to use some basic functions in calculation. For example: Power function to calculate power or a number, reverse function, not able to convert character to integer. Can you help me to achieve these basic functionalities?
This will be possible it just takes a bit of knowledge of the Boo language and .NET Framework. For example to calculate the power of a number you can use the Math.Pow() method in .NET's Math class: Math.Pow Method (Double, Double) (System). Boo is very capable to perform foreach and while loops: Language Guide: Loops · boo-lang/boo Wiki · GitHub.
I did a quick Google on how to convert base 36 to base 10 in .NET and found this C# example: Base36 Encoder/Decoder in C# – Not Rocket Science . You'll just need to turn that example Decode() method into Boo code which should be simple enough.
I have written a code to convert Base36 to Base10, but it is not working.
I have created a field and added it on the window. The calculation is performed Before Save.
The code is:
static def GetAttributeValue(Incident):
CharList = '34abcdef'
reversed = CharList.ToLower().Reverse()
result as long = 0
pos = 0
for c as char in reversed:
result += (CharList.IndexOf(c) * (Math.Pow(36, pos)))
pos += 1
I am not able to use Reverse() as it states that 'Reverse is not a member of String'.
If I remove Reverse from the code then I am not able to view result on the field specified. How can I solve these issues? Please help me regarding the same.