Flash Website Builder- Trendy Site Builder is a Flash Site Building tool that helps users build stunning websites. Check Out Custom Custom Logo Design by LogoBee. Website Design and Free Logo Templates available.
 CodingForums.com Octal to Binary (with code from Old Pedant)

Before you post, read our: Rules & Posting Guidelines

Enjoy an ad free experience by logging in. Not a member yet? Register.
 01-03-2013, 05:17 AM PM User | #1 Rich73505 New to the CF scene   Join Date: Jan 2013 Posts: 2 Thanks: 1 Thanked 0 Times in 0 Posts Octal to Binary (with code from Old Pedant) Happy 2013 all- I'm fumbling around with JavaScript in order to create a functional form in Adobe LiveCycle Designer ES2. I'm a hardware guy. I can plug an oscope in and show you code in the form of data pulses, I can trace it through comparators and registers through ALUs and shift registers, but I cannot tell you a thing about what it does. The hardware I work on has a 24 bit data bus. It runs periodic checks on itself and reports back in octal. The octal words reported look like this: (they could be any octal value, as long as they are in a group of eight digits) 04572100 00356001 00012000 00000000 00000001 00000540 00230000 05460000 The first octal word would be the following in binary: 000 100 101 111 010 001 000 000 which is 24 bits wide. I have to start counting at zero and end at 23, so my second task is to find the ones and note their positions. In this case, bits 3, 6, 8, 9, 10, 11, 13 and 17 are "high" and I have to chase these guys as voltages through schematics because they are faulted, swap the faulty component and test again. I decided to build a PDF form that could break the octal down to binary because I get PAGES of octal values and what follows is what was generously provided from O. P. : Code: ```var octalAsString = "04572100"; var num = parseInt( octalAsString, 8 ); // 8 means radix 8...octal var binaryString = num.toString(2); // 2 means binary // optional: break into groups of 3 bits: binaryString = binaryString.replace( /(\d\d\d)/g, "\$1 " ); alert( binaryString ); // or, all in one step: var binaryString2 = parseInt( octalAsString, 8 ).toString(2).replace( /(\d\d\d)/g, "\$1 " ); alert( binaryString2 );``` The syntax is indeed correct, but previewing PDF in ES2 results in a blank page. I have to get LiveCycle to act upon the code and I'm probably just not caffeinated to see what's missing. I tried to connect it to an octal number entry box (object) on the form, but the o.k. button remains greyed out and it won't link up. If you know of a fix, please advise. THANKS!
 01-03-2013, 05:27 AM PM User | #2 Old Pedant Supreme Master coder!     Join Date: Feb 2009 Posts: 24,949 Thanks: 75 Thanked 4,307 Times in 4,274 Posts You posted this in the wrong forum. A JS "Framework" means one of the libraries that function as a framework in JavaScript, such as jQuery, Mootools, etc. You need to post this in the ordinary JavaScript forum. Though likely a moderator will move it soon, anyway. ********** But in any case, I think you need to show how you attempted to integrate that basic code into your PDF page. Where are you getting the octal string from? How do you want to display the binary string? There aren't tons of Adobe LiveScript users around here, though. I know I've never used it. But the more info you can supply about how you tried to fit the basic code in place, the more likely somebody will be able to help you. __________________ An optimist sees the glass as half full. A pessimist sees the glass as half empty. A realist drinks it no matter how much there is.
 Users who have thanked Old Pedant for this post: Rich73505 (01-04-2013)
 01-04-2013, 05:33 AM PM User | #3 Rich73505 New to the CF scene   Join Date: Jan 2013 Posts: 2 Thanks: 1 Thanked 0 Times in 0 Posts Okay, I'll copy and paste into the "Post a JavaScript" forum. Thanks.

 Bookmarks

 Tags octal binary convert es2

 Thread Tools Rate This Thread Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home :: Client side development     JavaScript programming         DOM and JSON scripting         Ajax and Design         JavaScript frameworks         Post a JavaScript     HTML & CSS     XML     Flash & ActionScript         Adobe Flex     Graphics and Multimedia discussions     General web building         Site reviews         Building for mobile devices :: Server side development     Apache configuration     Perl/ CGI     PHP         Post a PHP snippet     MySQL         Other Databases     Ruby & Ruby On Rails     ASP     ASP.NET     Java and JSP     Other server side languages/ issues         ColdFusion         Python :: Computing & Sciences     Computer Programming     Computer/PC discussions     Geek News and Humour Web Projects and Services Marketplace     Web Projects         Small projects (quick fixes and changes)         Medium projects (new script, new features, etc)         Large Projects (new web application, complex features etc)         Unknown sized projects (request quote)         Vacant job positions         Looking for work/ for hire         Project collaboration/ partnership         Paid work offers and requests (Now CLOSED)     Career, job, and business ideas or advice     Domains, Sites, and Designs for sale         Domains for sale         Websites for sale         Design templates and graphics for sale :: Other forums     Member Offers     Forum feedback and announcements

All times are GMT +1. The time now is 07:28 PM.