Back after four years - should I update?

Please, everyone, review our forum guidelines if you don’t know the kind of forum we are. No need to be rude or hostile. We are a friendly forum where people can ask questions, collaborate and get help. We will issue warnings and ultimately ban people who continue to violate our guidelines.

This method

Worked fine in older versions, but with 2017 it generates a compiler error stating that a Uint64 is required.

[quote=361670:@James Sentman]It depends on what you will have to do later. Is this a one off re-compile and a simple single change and you’ll never have to revisit this code ever again? If so then just rebuild it in 2013 and be done with it. If you’re going to have to maintain this going forward, or have any other work that will be done in Xojo then you really need to put in the time to update and bring your code inline with the new changes. There aren’t that many and most that I can think of have already been mentioned in this thread.

If you have to do this more than once, then it’s worth it. Otherwise not.[/quote]

I agree. It’s more than a one-off recompile, it’s a new app with a new UI, building on the underlying communications framework, basic structure, and file system of the previous app. Maybe going through and fixing the bitwise issue would be all that’s required to make it work with Xojo 2017, but I’m afraid of going down a cascading wormhole of compiler errors and rewrites of low-level stuff. I think what I will do is get it basically working with the minimum required functionality on RS or Xojo 2013, as it’s got to be done in a week. In the process, I’ll re-learn how the thing works and how Xojo works, after which I’ll be ready to “port” it to the latest version of the IDE and add niceties.

This is weird. I rebuilt your method and it produces no errors, no matter if I pass integers, int16 or whatever int type I chose to pass to the method.

I get the same error if I declare mask as a Uint64.

It is the extends command which you did not use in your method above.
Without extends, the method works.
You could use an override of the method to make it work anyway. Use an additional

Public Function Bit(extends data as integer, bitpos as integer) as Boolean Return BitwiseAnd(CType(data, UInt64), 2^CType(Bitpos, uint64)) <>0 End Function

or, of course

Public Function Bit(extends data as integer, bitpos as integer) as Boolean Dim i As UInt64 = CType(data,UInt64) Return i.Bit(CType(bitpos, UInt64)) End Function

Thanks, Ulrich!