Roger Daley Well-Known Member Licensed User Longtime User Jan 28, 2015 #1 Hi All, I am trying to implement a NOT function on a string number, but it returns errors for anything > 7FFFFFFF using Bit.Not as Bit.Not operates Integer values [Signed 4 bite] I have added BigNumbers to the libraries and have tried the following code. Code: Copy Dim Disp As String Dim NOT As BigInteger Sub NOTFunction 'Stuff ,,, 'Disp = Bit.Not(Disp) Disp = Not(Disp) ' More stuff .. End Sub When I attempt to compile I get the following Error Message. Parsing code. Error Error parsing program. Error description: Unknown type: not Are you missing a library reference? Occurred on line: 32 Dim Not As BigInteger I have obviously missed something. Thanks in advance Regards Roger
Hi All, I am trying to implement a NOT function on a string number, but it returns errors for anything > 7FFFFFFF using Bit.Not as Bit.Not operates Integer values [Signed 4 bite] I have added BigNumbers to the libraries and have tried the following code. Code: Copy Dim Disp As String Dim NOT As BigInteger Sub NOTFunction 'Stuff ,,, 'Disp = Bit.Not(Disp) Disp = Not(Disp) ' More stuff .. End Sub When I attempt to compile I get the following Error Message. Parsing code. Error Error parsing program. Error description: Unknown type: not Are you missing a library reference? Occurred on line: 32 Dim Not As BigInteger I have obviously missed something. Thanks in advance Regards Roger
stevel05 Expert Licensed User Longtime User Jan 28, 2015 #2 NOT is a keyword, you can't use it as a variable name. Upvote 0
Roger Daley Well-Known Member Licensed User Longtime User Jan 28, 2015 #3 Steve105, Makes sense. I thought it looked wrong. I still have a problem as to the correct syntax. Changed code to the following: Code: Copy Dim Disp As String Dim BIGBit As BigInteger Sub NOTFunction 'Stuff ,,, 'Disp = Bit.Not(Disp) Disp = BIGBit.Not(Disp) ' More stuff .. End Sub I get the following: Parsing code. 0.17 Compiling code. Error Error compiling program. Error description: Array expected. Occurred on line: 3312 Disp = BIGBit.Not(Disp) Word: ( The BigNumbers Manual gives this info: Not As BigInteger Sets this BigInteger to a value that is NOT(this). The result of this operation is -this-1. Returns itself. I am still missing something. Can anyone give me a clue to the correct syntax when replacing Bit.Not() with the BigNumbers equivelent. Regards Roger Upvote 0
Steve105, Makes sense. I thought it looked wrong. I still have a problem as to the correct syntax. Changed code to the following: Code: Copy Dim Disp As String Dim BIGBit As BigInteger Sub NOTFunction 'Stuff ,,, 'Disp = Bit.Not(Disp) Disp = BIGBit.Not(Disp) ' More stuff .. End Sub I get the following: Parsing code. 0.17 Compiling code. Error Error compiling program. Error description: Array expected. Occurred on line: 3312 Disp = BIGBit.Not(Disp) Word: ( The BigNumbers Manual gives this info: Not As BigInteger Sets this BigInteger to a value that is NOT(this). The result of this operation is -this-1. Returns itself. I am still missing something. Can anyone give me a clue to the correct syntax when replacing Bit.Not() with the BigNumbers equivelent. Regards Roger
Erel B4X founder Staff member Licensed User Longtime User Jan 28, 2015 #4 This method doesn't expect any parameter: Code: Copy BigBit = BigBit.Not Upvote 0
Roger Daley Well-Known Member Licensed User Longtime User Jan 28, 2015 #5 Thanks Erel, Saved my sanity once again. Roger Code: Copy Dim Disp As String Sub NOTFunction Stuff.... BIGBit.Initialize(Disp) BIGBit = BIGBit.Not Disp = BIGBit More stuff... End Sub Upvote 0
Thanks Erel, Saved my sanity once again. Roger Code: Copy Dim Disp As String Sub NOTFunction Stuff.... BIGBit.Initialize(Disp) BIGBit = BIGBit.Not Disp = BIGBit More stuff... End Sub