I am trying to use NvParams 128 - 254. I have a function to read the parameters and a function to store a value.
setParam(128,'0417181135') displays 0417181135 when I read the parameter.
The following manipulations gave these results:
'a' is a string because I entered it as a string and I am able to slice it. I am also able to convert the slice into an integer.
Why doesn't 'b' convert to the integer 0417181135 if 'y' converts to integer 1135? Even if I replace the leading zero with a '1' I get 30871.
If I try to save the integer 0417181135, I get 'An invalid parameter value was entered'.
If I try to save the integer 417181135, I get 'An error occurred while trying to call the function setParam on node'.
Code:
def setParam(param, val):saveNvParam(param, val)def readParam(param):a = loadNvParam(param)rpc(portal, 'logEvent', a)
The following manipulations gave these results:
a = loadNvParam(128) | |
rpc(portal,'logEvent', a) | 0417181135 |
rpc(portal,'logEvent', type(a)) | 2 |
x = a[6:10] | |
rpc(portal,'logEvent', x) | 1135 |
rpc(portal,'logEvent', type(x)) | 2 |
y = int(x) | |
rpc(portal,'logEvent', y) | 1135 |
rpc(portal, 'logEvent', type(y)) | 1 |
b = loadNvParam(128) | |
b = int(b) | |
rpc(portal,'logEvent', b) | -20841 |
rpc(portal,'logEvent', type(b)) | 1 |
'a' is a string because I entered it as a string and I am able to slice it. I am also able to convert the slice into an integer.
Why doesn't 'b' convert to the integer 0417181135 if 'y' converts to integer 1135? Even if I replace the leading zero with a '1' I get 30871.
If I try to save the integer 0417181135, I get 'An invalid parameter value was entered'.
If I try to save the integer 417181135, I get 'An error occurred while trying to call the function setParam on node'.
Comment