matt1215 0 #1 August 14, 2006 Any fellow programmers in the house, VB-style in particular? Quote Share this post Link to post Share on other sites
shropshire 0 #2 August 14, 2006 Hate to admit it but........ I've programmed in VB.... but dont tell anyone. So, ask away... I can always use an alias to answer.. (.)Y(.) Chivalry is not dead; it only sleeps for want of work to do. - Jerome K Jerome Quote Share this post Link to post Share on other sites
mailin 0 #3 August 14, 2006 .net programmer here... haven't done a TON of vb.net, I do mostly c#, but I have done some...Arianna Frances Quote Share this post Link to post Share on other sites
PhreeZone 20 #4 August 14, 2006 I'm ashamed to admit that at one point I was fairly decent in VB 6.0 Don't tell anyone OK?Yesterday is history And tomorrow is a mystery Parachutemanuals.com Quote Share this post Link to post Share on other sites
matt1215 0 #5 August 14, 2006 Very cool!! I wrote a program that generates a binary file, containing strategically placed bytes to program a machine. One of the values is a large number and I'm not sure how to split it into 2 bytes. What looks like 7FFF in hex (or 32767 as input into a form) needs to look like FF 7F when viewed in the hex-editor. I've already programmed byte placement, dumping inputs into a byte-array and looping thru a case statement. Problem is how do I get 7F from 7FXX (or 127 from 32512)? Ideas? Quote Share this post Link to post Share on other sites
brianfry713 0 #6 August 14, 2006 result = pattern >> 8 Sounds like you want to do an arithmetic (sign extended) right shift of 8 bits. Quote Share this post Link to post Share on other sites
mailin 0 #7 August 14, 2006 eek - I like my windows programming, thankyouverymuch. I haven't touched binary/hex manipulation since my second semester in school... Good luck with that JenArianna Frances Quote Share this post Link to post Share on other sites
Auram 0 #8 August 14, 2006 I second what brianfry said. right shift it 8 bits Quote Share this post Link to post Share on other sites
riddler 0 #9 August 14, 2006 I'm not ashamed to say my first programming language was BASIC, as in Beginner's All-purpose Symbolic Instruction Code. Circa 1980. I was 10. I never cared for Micro$oft's visual version of it, although I've written more than a few apps in it when my customers request it.Trapped on the surface of a sphere. XKCD Quote Share this post Link to post Share on other sites
PhreeZone 20 #10 August 14, 2006 I've got a VIC20 book around here if you want to go old school again Yesterday is history And tomorrow is a mystery Parachutemanuals.com Quote Share this post Link to post Share on other sites
matt1215 0 #11 August 14, 2006 Quote eek - I like my windows programming, thankyouverymuch. I haven't touched binary/hex manipulation since my second semester in school.. LOL, I'd much rather program for Windows, but an updated program was requested that doesn't run on DOS. Think I figured out a solution, provided my understanding of RoundDown() and hex are correct. Input = TXTInput.Text SmallInput = Input/256 Bigbyte = RoundDown (SmallInput) SmallByte = (SmallInput – Bigbyte) * 256 Find out tomorrow when I plug that into the compiler. Quote Share this post Link to post Share on other sites
shropshire 0 #12 August 14, 2006 same here (and even earlier versions too) .... it's our little secret (.)Y(.) Chivalry is not dead; it only sleeps for want of work to do. - Jerome K Jerome Quote Share this post Link to post Share on other sites
champu 1 #13 August 14, 2006 Quoteresult = pattern >> 8 Sounds like you want to do an arithmetic (sign extended) right shift of 8 bits. ah... what fun... To get the two parts of a 16-bit integer and force write it as either "big-endian" or "little-endian" you can isolate the 8msbs as described above (right bit-shift by 8) and the 8lsbs by masking the input appropriately. I forget what the bit-wise logical AND operator is in visual basic, but in C... foo = bar & 255; Be sure and pay attention to the most signifigant bit too, whether you're using signed integers or unsigned integers on your target hardware makes a big difference as to its meaning. /edited to add: Quote Input = TXTInput.Text SmallInput = Input/256 Bigbyte = RoundDown (SmallInput) SmallByte = (SmallInput – Bigbyte) * 256 That'll prolly work. I'm hesitant cause my immediate thought when I see that is "floating point errors", but I may just be paranoid. Quote Share this post Link to post Share on other sites
matt1215 0 #14 August 14, 2006 QuoteThat'll prolly work. I'm hesitant cause my immediate thought when I see that is "floating point errors", but I may just be paranoid. Good point. Might be a good idea to declare SmallInput as a Double. Thanks Quote Share this post Link to post Share on other sites misaltas 0 #15 August 16, 2006 Also, good forums here and here. Still lots of folks out there still using VB6. .Ohne Liebe sind wir nichts Quote Share this post Link to post Share on other sites Join the conversation You can post now and register later. If you have an account, sign in now to post with your account. Note: Your post will require moderator approval before it will be visible. Reply to this topic... × Pasted as rich text. Paste as plain text instead Only 75 emoji are allowed. × Your link has been automatically embedded. Display as a link instead × Your previous content has been restored. Clear editor × You cannot paste images directly. Upload or insert images from URL. Insert image from URL × Desktop Tablet Phone Submit Reply 0
misaltas 0 #15 August 16, 2006 Also, good forums here and here. Still lots of folks out there still using VB6. .Ohne Liebe sind wir nichts Quote Share this post Link to post Share on other sites