New topic: Checking integer type of variant?
<http://forums.realsoftware.com/viewtopic.php?t=47222> Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message lukus001 Post subject: Checking integer type of variant?Posted: Fri Mar 08, 2013 9:00 pm Joined: Sat Jul 16, 2011 2:45 pm Posts: 51 Hey guys, I have a function to serialises an integer in to a specific format, however for me to be able to do that I have to know whether the number is a signed number or an unsigned number. The way I have it set so far is a simple variant array which the serialiser loops over, checks the data type and writes accordingly. However, I can only check to see if it's a numeric - not what type of numeric? Is there no way of doing something such as "isa Uint32" ? The reason this is important is because this format uses a viable-byte length number type consisting of 1-4 bytes - 1-3 bytes signify an unsigned number whereas 4 bytes signify a signed number (plus the sign is moved due to the header bits used to make it variable sized) therefore it's impossible for me to 'just simply cast it' as Uint32 as the number will not only be deserialised into a completely different number, but also be defined as the wrong format. The only solution that I can see is to create a class specific for one type, such as "Signed_Value" so i can do "isa signed_value" ? Though I'm posting in hopes I've missed a really simple function to do this O_O Top swort Post subject: Re: Checking integer type of variant?Posted: Fri Mar 08, 2013 9:52 pm Joined: Mon May 31, 2010 5:35 am Posts: 2371 Location: Netherlands do you mean: http://docs.realsoftware.com/index.php/Variant.Type Variant.Type ? _________________ SWORT⢠- Windows Vista, Windows XP, Windows 7, Linux Mint 11 and Mac OSX Lion - REAL Studio Enterprise(latest) and WEB Edition(latest) - Plugins (MBS Complete, ToringoLib, Einhugur, VanHoek + Some open source plugins) For Dutch User Groups ask me to enter! Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 2 posts ]
-- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
