Floating issue

I have a sidebar div floated left (with a background gif), and a main content div (with dark grey background) so they sit nicely next to each other. When I insert an image into the main content div, both divs stay in place, but the content is pushed below (the inserted image is being blocked from floating within its parent div).
See attached.
So far, floating divs seems to work perfectly until I actually try to add content inside those divs. Then it falls apart. Not good. Any suggested fixes? 

There are many tools in a developer's toolbox. Sometimes one tool seems more appropriate, sometimes another.
Your best bet is to learn both and make your own choice, depending on how it will be used. I think a lot of how code is used ties in with the way you are thinking about the site you are building, how you have conceptualized it, and the pieces you are fitting together to build it, and those are perforce quite individual, developer to developer.
An unnoticed unclosed CSS statement or an extra space where it doesn't belong can break code.
I think you handled it correctly by deleting and rewriting. It's a much cleaner approach than to try to jigger code that has an error in it somewhere.
You should also make use of Validation tools to help check your code for you. There's one integral to Dreamweaver, and many developers also use Validator tools on the Web.
Z

Similar Messages

  • IE8 Floating Issues in e-commerce

    Hello Folks,
    I am using the e-commerce module, and have everything up and working, however it has been brought to my attentiton that ONLY IN IE8 browsers, the "Individul Product Small" units are not floating correctly. If you open up this link: 
    http://www.steannes.com/tea-selection.html in IE9, IE10, or Firefox, etc., you will notice that the float is correct, however in IE8 the boxes are floating in a single column down the left hand side. I have tried everything that I can think of and nothing seems to working, after 2 days of no progress, I look for your guidance.
    Many thanks,
    Katriona

    Hey there Katriona, modern broswers do a fairly decent job trying to handle incorect css and HTML. Alaways amazed by the smarts behind firefox to do that. Not always a good thing through as something incorect can go unoticed unless you have a good coding software that shows you.
    You have the float on the div of the small product layout with the css there. If you look at the rendered html the parent is the LI. this is the containing element for each item and that is the one that needs to be floated and margin etc.
    Every time you do a float with margins as well the fist (if you use left) and the last (if you use right) will not go to the edge as it should because that actually needs no margin. You can use nth item (css, google, it is cool) for good browsers but for older you would need to use javascript to get that right. It is not a deal breaker though but if you want to get it 100% that is what you do.
    The other thing is to clear your floats. For IE8 it will understand the css (Clearfix) code (again, google you will find heaps on that) but this wont work in IE7 so a traditional clear class after floated elements will be needed for example.
    Do a bit of googling, palace your positioning CSS on the LI not the Div and you will have it about right and the info you learn will also help you with future stuff and avoid similar issues as well as you know the whys and hows

  • Php and float issue

    I have created a <div "content"> with inside two divs:
    <div "left"> and <div "right">
    I want both to be adjacent, so the left div I float. In the left I want some images and text, in the right I want a php form. This form works perfect in a regular division, and also in the <div "right"> as long as I don't float the left division.
    This is the php function: <?php include_once("gbcf-v3/form.php"); ?>
    The widht of the div is sufficient for the form; the webpage appears properly with the form showing, if I don't float the left div (but then the form shows up underneath to the right of the left div. If I float the left div, to get the form show up adjacent to the left div, the webpage stays blanc. And yes, I transfer the styles directory to my server every time I change a style.
    What do I do wrong?
    Thanks for any help,
    Erik
    Here is the link to the page, showing the php form in the wrong place (underneath instead of to the right of my text and image):
    http://mysafety.be/inbraakbeveiliging%20promoties%20v2.html

    The css errors have been corrected, the html errors are in process. I already have the form where I want: http://mysafety.be/inbraakbeveiliging%20promoties%20v2.html
    There are still errors, but I see you've managed to get the form where you want it.
    1. I am puzzled by your xhtml comment, more out of ignorance then anything else: when starting up this site I choose xhtml v1.0 transitional just because I was thought to do so in one of the Dreamweaver tutorials. Should I rather use HTML 4.0 transitional straight away in the future?
    Since you are just starting out, I recommend learning 4.01 Strict. This will make your HTML documents easier to upgrade to 5.0x when it is eventually approved. Others may recommend using 4.01 Transitional as you develope your skills in HTML. I personally think Transitional is good for those who learned the old, deprecated and/or obsolete versions and need to transition to the stricter versions. (XHTML uses 4.01 Strict as its starting point).
    What is the pro and con of html 4.0 transitional vs xhtml 1.0 transitional?
    IMO, XHTML is more a fad than anything. It DOES have its place, but it has been, at best, poorly implemented. And if you do not know what it is for, or how to use its features, it doesn't make much sense to use that DOCTYPE. Here are some specifics written by others http://en.wikipedia.org/wiki/Xhtml#Criticism
    Mark A. Boyd
    Keep-On-Learnin' :-)

  • Background and float issues

    I have some side nav items that are not showing the background color. Can't figure out why.
    http://www.aptcoweb.com/dev/aptcoFluid/
    Also, 3 divs near the bottom with the class of col are not floating. What's wrong there?

    larrycfc wrote:
    Interesting, Nancy. I already had it targeted in .side li a:hover but that wasn't working. Too specific? I moved those selections into simple .side a:hover and it works. Then I disabled the ones in li and it still works. What's the explanation for this behavior?
    Its because you have no anchor inside .side li  - the anchor is inside .side
    <li class="side"><a href="/promo/index.htm">Promotional<br />Products</a></li>
    For .side li a:hover to work the structure would need to look like below:
    <div class="side">
    <li><a href="/promo/index.htm">Promotional<br />Products</a></li>
    </div>

  • CSS Three Column Float issue

    I created this website utilizing the three column fixed width
    CSS template from Dreamweaver. I'm having issues with the center
    column coming after the content in the 3rd column. Thought it was
    an issue with content being too wide but changed that and it's
    still occuring. Of course it's fine in Firefox but IE6 it's a no
    go.
    http://www.clotheshorseconnection.com/
    Any help is greatly appreciated.
    Thanks,
    Cheryl

    Cheryl,
    Are you're using DW CS3? If so, have you tried the new
    Browser
    Compatibility Check feature?
    File > Check Page > Browser Compatibility
    Hope this helps,
    Randy
    > I created this website utilizing the three column fixed
    width CSS template from
    > Dreamweaver. I'm having issues with the center column
    coming after the content
    > in the 3rd column. Thought it was an issue with content
    being too wide but
    > changed that and it's still occuring. Of course it's
    fine in Firefox but IE6
    > it's a no go.
    >
    >
    http://www.clotheshorseconnection.com/
    >
    > Any help is greatly appreciated.
    >
    > Thanks,
    > Cheryl

  • Video embed float issue!

    Embedded videos are floating in front of all other objects. I had them embedded in a slideshow widget, then I tried it outside of a widget, directly on the page... the same result! My lightbox menu objects are obscured by the video when opened. I have tried moving the video to back, and moving the lightbox widget to front, but no luck. I have tried youtube (even the old code), and also a facebook embed. In only firefox, half of the lighbox objects are obscured, and some are visible, but why? What can I do??? Here is the link:
    www.tightenupgirl.businesscatalyst.com

    Add wmode="transparent" to the embed tag (in addition to the wmode param in the object tag).
    <object width="560" height="315"><param name="movie" value="http://www.youtube.com/v/B6hzf_gbuj0?version=3&hl=en_US&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/B6hzf_gbuj0?version=3&hl=en_US&rel=0" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true" wmode="transparent"></embed></object>

  • Odd floating point issue, can anone explain it

    Hi
    Below I have pinpointed an odd problem that I recently found using the newest express build of the compiler. Can
    anyone reproduce it ? Can anyone explain what the problem is ?
    Thanks a lot in advance,
    Cheers, Jacob
    jwp@per$ cat foo_simple.f90
    program foo
    implicit none
    integer(4) :: ta(8)
    call date_and_time(values=ta)
    write(*,*) 'floating issue', (ta(8))*(1.0e-3)
    end program
    jwp@per$ /data/sw/sunstudio_201006/solstudioex1006/bin/f95 -g -O0 -ftrap=%all -fsimple=0 -fns=no foo_simple.f90
    jwp@per$ ./a.out
    Floating point exception
    jwp@per$

    Thanks for getting back. Isn't is so that ta must be an integer to be passed onto date_and_time ? So is your suggestion to do something like
    real(4) :: a
    call date_and_time(values=ta)
    a=real((ta(8)))
    write(*,*) 'floating issue', a*(1.0e-3_4)
    or
    real(8) :: a
    call date_and_time(values=ta)
    a=dble((ta(8)))
    write(*,*) 'floating issue', a*(1.0e-3_8)
    ??? Unfortunately, both expressions above also gives rise to a floating point exception. Maybe I misread your suggestion.
    Cheers, Jacob

  • Rating Widget: CSS Float question

    I've successfully modified the Rating widget with our own rating graphics (smaller star's) but one issue I cannot figure out is how to get rid of what looks like a margin or padding around the ratingButtons... actually, everything within the ratingContainer itself. Everything works fine, just trying to tweak it's apperance on screen in relationship to other elements above and below the widget.
    In SpryRating.css, the ratingContainer is floated left as well as the ratingButton(s) by default. I didn't change that. I did however change the width and height of the .ratingButton classes to match the new width and heigh of the graphic elements.
    I think this is really more of a CSS/Float issue, but I haven't been smart enough to figure it out over the past few days while trying to research.
    The end result should make the ratingContainer the same height as the ratingButton(s).  I've already tried specific values for the height of the ratingContainer as well as 'auto'.
    Any help would be welcome and appreciated! Thanks!
    -JL

    jasonLampitt wrote:
    Really?
    So, I'm either completely misconstruing your reply (which I admit is possible) but I'm more inclined to take it at face value.
    I am sorry, I fail to see what was ambigious in my reply. I am merely stating the facts and I am sorry that you managed to see otherwise.
    As a contributor to this forum and having no connection to Adobe other than to use their products, I use my spare time to help others with THEIR problems.
    In doing so, we ask that person to assist us so that we can experience the problem first hand which in turn will be indusive to an objective answer.
    In your case we have not been able to reconstruct the problem, thus we have not been able to help. This is of no concern to us, but it does not help you.
    Have a good day!

  • Background color and float problems

    Hello all,
    I am having a problem with the background color and the left
    float for a navigation sidebar (also with the background color for
    the footer). The body color is set to gray, and the main page is
    centered with a white background. I set up the pages using mostly
    CSS, with a few tables where they seemed necessary. I set up the
    navigation side bar as a div with a green background and a left
    float. The footer is set up as a div with a green background. All
    text is aligned left.
    When I preview in Safari, everything looks as expected.
    In Firefox and IE5: The background color of the navigation
    sidebar has white showing up behind the type that are not links
    (e.g., mailing address and subheads). The div does not float all
    the way to the left edge of the page. The background color of the
    footer should be green but shows up as white. I validated the code
    in DW, and it reports no problems (at least, it checked out after I
    made a few corrections).
    I am not that concerned about the background color for the
    footer -- it is either all there (in Safari) or not there at all
    (in Firefox and IE). But I would like to see if I can make it show
    up. For the navigation sidebar, would putting it in a table cell
    make it work correctly in Firefox and IE?
    Regarding the left float issue for the nav sidebar IE5: At
    the top of the page, my logo banner (it's placed in a div) shifted
    to the right (in IE only). When I added a left float to the banner,
    the banner lines up fine with the rest of the page, but a white
    margin appears along the left side of the entire page.
    None of my pages are uploaded to a web host yet. This is my
    first website. I am working in DW8 on a Mac.
    Thanks in advance,
    Kathy (Daylilybud)

    Mista,
    Here is my home page based on the template I sent previously.
    Thanks in advance!
    Kathy (Daylilybud)
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=UTF-8" />
    <title>Loon Song Gardens: Home Page</title>
    <link href="externalcss/informationcss.css"
    rel="stylesheet" type="text/css" />
    <style type="text/css">
    <!--
    a {
    font-weight: bold;
    -->
    </style></head>
    <body>
    <div id="container">
    <div id="banner"><a name="topofpage"
    id="topofpage"></a><img
    src="graphics/thumbnailsheader/lsgheadergraphic_760x110.jpg" alt=""
    width="760" height="110" />
    <div id="heading"><img
    src="graphics/thumbnailsheader/hotcolorstrip760.jpg" alt=""
    width="760" height="76" /></div>
    <div id="navsidebar">
    <p class="navsidebarnormal">Loon Song Gardens,
    LLC<br />
    10910 109th Ave N<br />
    Champlin MN 55316<br />
    763.422.0015</p>
    <ul class="ulnavsidebar">
    <li class="ulnavsidebarli"><a
    href="../donotuse/indextest4.html">Homepage</a></li>
    <li class="ulnavsidebarli"><a
    href="about_loonsonggardens/aboutus.html">About
    Us</a></li>
    <li class="ulnavsidebarli"><a
    href="about_loonsonggardens/our_daylilies/aboutourintroductions.html">Our
    Introductions</a></li>
    <li class="ulnavsidebarli">Seedlings</li>
    <li class="ulnavsidebarli">Photo Gallery</li>
    <li class="ulnavsidebarli"><a
    href="pricelist2008/pricelist2008ab2.html">2008 Price
    List</a></li>
    <li class="ulnavsidebarli"><a
    href="pricelist2008/lsgorderform2008website.pdf">Order Form
    (PDF)</a></li>
    <li class="ulnavsidebarli"><a
    href="about_loonsonggardens/shippingandterms.html">Shipping and
    Terms</a></li>
    <li class="ulnavsidebarli"><a
    href="about_loonsonggardens/visitus.html">Visit
    Us</a></li>
    <li class="ulnavsidebarli"><a
    href="mailto:[email protected]">Email Us
    </a></li>
    </ul>
    <p> <span class="navsubheadbold">ABOUT
    DAYLILIES</span> </p>
    <ul class="ulnavsidebar">
    <li class="ulnavsidebarli"><a
    href="about_daylilies/howtoplant.html"
    class="ulnavsidebarli">How to Plant</a></li>
    <li class="ulnavsidebarli"><a
    href="about_daylilies/growingtips.html"
    class="ulnavsidebarli">Growing Tips</a></li>
    <li class="ulnavsidebarli"><a
    href="about_daylilies/howtodivideadaylily.html"
    class="ulnavsidebarli">How to Divide</a></li>
    <li class="ulnavsidebarli"><a
    href="about_daylilies/moreaboutdaylilies.html"
    class="ulnavsidebarli">More About Daylilies</a></li>
    </ul>
    <p> <span class="navsubheadbold">OTHER
    LINKS</span> </p>
    <ul class="ulnavsidebar">
    <li class="ulnavsidebarli"><a href="
    http://www.daylilies.org"
    class="ulnavsidebarli">American Hemerocallis <br />
    Society (AHS)</a></li>
    <li class="ulnavsidebarli"><a href="
    http://www.daylilies.org/ENews.html"
    class="ulnavsidebarli">AHS Daylily E-News <br />
    (FREE SUBSCRIPTION) </a></li>
    </ul>
    </div>
    <div id ="content">
    <h1>Welcome to Loon Song Gardens! </h1>
    <ul>
    <li class="contentli">We specialize in northern-hardy
    daylilies (<em>Hemerocallis</em>).</li>
    <li class="contentli">Our daylilies are field
    grown.</li>
    <li class="contentli">We offer competitive
    prices.</li>
    <li class="contentli">Loon Song Gardens, LLC, is a
    licensed and inspected nursery.</li>
    <li class="contentli">We are an American Hemerocallis
    Society Display Garden. </li>
    <li class="contentli">Visitors are welcome by
    appointment.</li>
    </ul>
    <p>Loon Song Gardens is a specialty daylily nursery
    and the home of Mike and Kathy Lamb in Champlin, Minnesota, USDA
    hardiness zone 4. We grow over 1,000 named daylily cultivars in a
    wide range of colors, sizes, and forms, from classics to cutting
    edge. If you are looking for northern-hardy daylilies, check with
    us! We will gladly share our growing experiences with you so you
    may have the best possible success.Kathy hybridizes daylilies and
    has introduced four daylily cultivars to date. For details, see
    <a
    href="about_daylilies/about_loonsonggardens/our_daylilies/ourintroductionsmain.html">Our
    Introductions </a> and <a
    href="about_daylilies/about_loonsonggardens/our_daylilies/seedlingsandfutures.html">Seedl ings.</a></p>
    <h2>Are you new to the world of daylilies? </h2>
    <p>Learn more about daylilies! Use the links in the
    left sidebar to find answers to your questions. Check back for
    updates. If you have questions, send us an email, and we will try
    to help.</p>
    <h2>To place your order</h2>
    <p class="contentp">Use our on-line <a
    href="about_daylilies/pricelist2008/pricelist2008v215ab.htm">2008
    Price List </a> to make your selections. We are a small
    nursery and quantities are limited, so it is best to confirm your
    order via email.</p>
    <p class="contentp">To place your order, print the
    <a
    href="about_daylilies/pricelist2008/lsgorderform2008website.pdf">Order
    Form (PDF)</a>, fill it in, enclose payment by check or money
    order (payable to Loon Song Gardens, LLC), and mail to:</p>
    <blockquote>
    <p class="contentp"> Loon Song Gardens<br />
    10910 109th Ave N <br />
    Champlin MN 55316</p>
    </blockquote>
    <p>We ship at least a double-fan size plant unless
    otherwise noted in our listings, we include a bonus for orders of
    at least $35, and we guarantee that our plants are true to
    name.</p>
    <h2>Visit Loon Song Gardens</h2>
    <p>Loon Song Gardens is an official American
    Hemerocallis Society (AHS) Daylily Display Garden, open by
    appointment. If you will be in the Minneapolis area and would like
    to stop by, please contact us to schedule a time. For details,
    click on <a
    href="about_daylilies/about_loonsonggardens/visitloonsonggardens.html">Visit
    Us</a>. </p>
    <h2>Join the American Hemerocallis Society
    (AHS)</h2>
    <p>The AHS website includes lots of great daylily
    information, so be sure to take a look. </p>
    <p>Join AHS today and take advantage of the voucher
    program! New AHS members receive a voucher good for at least $25.00
    toward daylilies from participating vendors (a minimum purchase may
    apply). To join AHS, go directly to <a href="
    http://www.daylilies.org/AHSmemb.html">AHS
    Membership</a>.</p>
    <p>Kathy is currently on the AHS Board of Directors as
    Chair of Publicity and Media Relations. She produces <em>AHS
    Daylily E-News,</em> an e-newsletter free for AHS members and
    non-members alike. To subscribe, click on <a href="
    http://www.daylilies.org/ENews.html">AHS
    Daylily E-News</a>. </p>
    </div>
    <div id="topofpage"><a href="#topofpage">Top of
    Page</a></div>
    </div>
    <div id="footer"><!-- #BeginLibraryItem
    "/Library/footer1.lbi" -->
    <p class="footer">&copy; 2008 Loon Song Gardens,
    LLC. All rights reserved. | Loon Song Gardens, LLC | 10910 109th
    Avenue North | Champlin MN 55316<br />
    <a href="mailto:[email protected]">Email
    us</a>| | 763.422.0015 | Fax 763.422.0131 | This page was
    last updated
    <!-- #BeginDate format:Am1 -->March 30, 2008<!--
    #EndDate -->
    </p>
    <!-- #EndLibraryItem --></div>
    </div>
    </body>
    </html>

  • Floating sidebar divs in DW6

    I'm trying to totally remake my antiquated FP website using DW.  I'm a goat herder and DIY'er and NOT a coder.  Using fluid grids in DW6 I'd like to use three divs stacked on the left to be my side bar (#logo, #mainNav, #sidebar) and then three divs stacked on the right for #header, #content,# footer.  I can't get the 3 sidebar divs to stay together vertically once the content div is longer .  I know it's a float issue but can't figure out how to deal with it.  I want separate divs on the side bar so that i can make the bottom one hidden for mobile devices.
    Is there a way to do what I'm trying to do?

    The way you're describing it, no.  For better help, we need to see a link to your page. 
    Always build Mobile first because everything else is based on that primary structure.  Then build Tablet, followed by Desktop.
    Basically, you  need a very basic HTML5 structure inside your body tag.
    <div class"gridContainer clearfix">
    <header>
         Logo, SiteName & Slogan
    </header>
    <nav>Menu</nav>
    <aside>
         Sidebar1
    </aside>
    <article>
         Main content
    </article>
    <aside>
         Sidebar2
    </aside>
    <footer>
         Footer
    </footer>
    <!--end gridContainer-->
    </div>
    In mobile devices, all these divisions should be full width and stacked on top of each other.
    In Tablets & Desktops, you might float:left the <aside>, <article>, <aside> divisions.
    Does that help?
    Nancy O.

  • Error Messages within a development

    All,
    Another problem i have is that i want to display an image of a red cross before any error message that is displayed to a customer using the development. At the moment, the default is just the word 'ERROR', followed by the particular error message.
    I know how to insert an image of a red cross, i have loaded that into the images folder and are asking the error to show the image, but the problem i am having is that the image is being inserted over the text 'ERROR'.
    Does anyone know how i can move the text of the error message slightly to the right so the image is not on top of it? It sounds like a simple padding or floating issue but i can't fix it. Which css file would i need to amend, what code shoild i look for, and what should i change it to?
    Thanks
    Rob

    Unfortunately this really boils down to HTML layout troubleshooting. Best advice is to try different things to see what gets you closer to a solution, and what doesn't.

  • Issue with setting float point in Textfield

    hi
    i have an issue with float input in a textfield.
    what i want to do is.
    when the user start typing numerics it should accept from right hand side and keep appending value from right hand side.
    for ex
    if i want to enter 123.45
    user starts entering
    1 then it should display as 0.01
    2 then it should display as 0.12
    3 then it should display as 1.23
    4 then it should display as 12.34
    5 then it should display as 123.45
    to achive this i have written the code as below
    public class Test{
         public static void main(String[] a){
         try {
    UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    } catch (Exception evt) {}
    DecimalFormat format = new DecimalFormat();
    format.setGroupingUsed(true);
    format.setGroupingSize(3);
    format.setParseIntegerOnly(false);
    JFrame f = new JFrame("Numeric Text Field Example");
    final DecimalFormateGen tf = new DecimalFormateGen(10, format);
    // tf.setValue((double) 123456.789);
    tf.setHorizontalAlignment(SwingConstants.RIGHT);
    JLabel lbl = new JLabel("Type a number: ");
    f.getContentPane().add(tf, "East");
    f.getContentPane().add(lbl, "West");
    tf.addKeyListener(new KeyAdapter(){
         public void keyReleased(KeyEvent ke){
              char ch = ke.getKeyChar();
              char key;
              int finalres =0;
              String str,str1 = null,str2 =null,str3 = null,str4= null;
              if(ke.getKeyChar() == KeyEvent.VK_0 || ke.getKeyChar() == KeyEvent.VK_0 ||
                        ke.getKeyChar() == KeyEvent.VK_0 || ke.getKeyChar() == KeyEvent.VK_1 || ke.getKeyChar() == KeyEvent.VK_2 ||
                             ke.getKeyChar() == KeyEvent.VK_3 || ke.getKeyChar() == KeyEvent.VK_4 || ke.getKeyChar() == KeyEvent.VK_5 ||
                             ke.getKeyChar() == KeyEvent.VK_6 || ke.getKeyChar() == KeyEvent.VK_7 || ke.getKeyChar() == KeyEvent.VK_8 ||
                             ke.getKeyChar() == KeyEvent.VK_9 ){
                   double value1 = Double.parseDouble(tf.getText());
                   int position = tf.getCaretPosition();
                   if(tf.getText().length() == 1){
                        if(tf.getText() != null || tf.getText() != ""){
                        value1 = value1 / 100;
                        tf.setText(String.valueOf(value1));
                   /*else if(tf.getText().length() == 3){
                        str = tf.getText();
                        for(int i=0;i<str.length();i++){
                             if(str.charAt(i) == '.'){
                                  str1 = str.substring(0,i);
                                  str2 = str.substring(i+1,str.length()-1);
                                  break;
                        key = ke.getKeyChar();
                        finalres = calculate.calculate1(str2,key);
                        str3 = merge.merge1(str1,finalres);
                        tf.setText(str3);
                        System.out.println(key);
                        System.out.println(str1);
                        System.out.println(str2);
                   else{
                        value1 = Float.parseFloat(tf.getText());
                        value1 = value1*10;
                        tf.setText(String.valueOf(value1));
    tf.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent evt) {
    try {
    tf.normalize();
    Long l = tf.getLongValue();
    System.out.println("Value is (Long)" + l);
    } catch (ParseException e1) {
    try {
    Double d = tf.getDoubleValue();
    System.out.println("Value is (Double)" + d);
    } catch (ParseException e2) {
    System.out.println(e2);
    f.pack();
    f.setVisible(true);
    import javax.swing.JTextField;
    * Created on May 25, 2005
    * TODO To change the template for this generated file go to
    * Window - Preferences - Java - Code Style - Code Templates
    * @author jagjeevanreddyg
    * TODO To change the template for this generated type comment go to
    * Window - Preferences - Java - Code Style - Code Templates
    import java.awt.Toolkit;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.text.DecimalFormat;
    import java.text.ParseException;
    import java.text.ParsePosition;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JTextField;
    import javax.swing.UIManager;
    import javax.swing.text.AbstractDocument;
    import javax.swing.text.AttributeSet;
    import javax.swing.text.BadLocationException;
    import javax.swing.text.Document;
    import javax.swing.text.PlainDocument;
    import javax.swing.text.AbstractDocument.Content;
    public class DecimalFormateGen extends JTextField implements
    NumericPlainDocument.InsertErrorListener {
         public DecimalFormateGen() {
         this(null, 0, null);
         public DecimalFormateGen(String text, int columns, DecimalFormat format) {
         super(null, text, columns);
         NumericPlainDocument numericDoc = (NumericPlainDocument) getDocument();
         if (format != null) {
         numericDoc.setFormat(format);
         numericDoc.addInsertErrorListener(this);
         public DecimalFormateGen(int columns, DecimalFormat format) {
         this(null, columns, format);
         public DecimalFormateGen(String text) {
         this(text, 0, null);
         public DecimalFormateGen(String text, int columns) {
         this(text, columns, null);
         public void setFormat(DecimalFormat format) {
         ((NumericPlainDocument) getDocument()).setFormat(format);
         public DecimalFormat getFormat() {
         return ((NumericPlainDocument) getDocument()).getFormat();
         public void formatChanged() {
         // Notify change of format attributes.
         setFormat(getFormat());
         // Methods to get the field value
         public Long getLongValue() throws ParseException {
         return ((NumericPlainDocument) getDocument()).getLongValue();
         public Double getDoubleValue() throws ParseException {
         return ((NumericPlainDocument) getDocument()).getDoubleValue();
         public Number getNumberValue() throws ParseException {
         return ((NumericPlainDocument) getDocument()).getNumberValue();
         // Methods to install numeric values
         public void setValue(Number number) {
         setText(getFormat().format(number));
         public void setValue(long l) {
         setText(getFormat().format(l));
         public void setValue(double d) {
         setText(getFormat().format(d));
         public void normalize() throws ParseException {
         // format the value according to the format string
         setText(getFormat().format(getNumberValue()));
         // Override to handle insertion error
         public void insertFailed(NumericPlainDocument doc, int offset, String str,
         AttributeSet a) {
         // By default, just beep
         Toolkit.getDefaultToolkit().beep();
         // Method to create default model
         protected Document createDefaultModel() {
         return new NumericPlainDocument();
         // Test code
         public static void main(String[] args) {
         try {
         UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
         } catch (Exception evt) {}
         DecimalFormat format = new DecimalFormat("#,###.###");
         format.setGroupingUsed(true);
         format.setGroupingSize(3);
         format.setParseIntegerOnly(false);
         JFrame f = new JFrame("Numeric Text Field Example");
         final DecimalFormateGen tf = new DecimalFormateGen(10, format);
         tf.setValue((double) 123456.789);
         JLabel lbl = new JLabel("Type a number: ");
         f.getContentPane().add(tf, "East");
         f.getContentPane().add(lbl, "West");
         tf.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent evt) {
         try {
         tf.normalize();
         Long l = tf.getLongValue();
         System.out.println("Value is (Long)" + l);
         } catch (ParseException e1) {
         try {
         Double d = tf.getDoubleValue();
         System.out.println("Value is (Double)" + d);
         } catch (ParseException e2) {
         System.out.println(e2);
         f.pack();
         f.setVisible(true);
         class NumericPlainDocument extends PlainDocument {
         public NumericPlainDocument() {
         setFormat(null);
         public NumericPlainDocument(DecimalFormat format) {
         setFormat(format);
         public NumericPlainDocument(AbstractDocument.Content content,
         DecimalFormat format) {
         super(content);
         setFormat(format);
         try {
         format
         .parseObject(content.getString(0, content.length()), parsePos);
         } catch (Exception e) {
         throw new IllegalArgumentException(
         "Initial content not a valid number");
         if (parsePos.getIndex() != content.length() - 1) {
         throw new IllegalArgumentException(
         "Initial content not a valid number");
         public void setFormat(DecimalFormat fmt) {
         this.format = fmt != null ? fmt : (DecimalFormat) defaultFormat.clone();
         decimalSeparator = format.getDecimalFormatSymbols()
         .getDecimalSeparator();
         groupingSeparator = format.getDecimalFormatSymbols()
         .getGroupingSeparator();
         positivePrefix = format.getPositivePrefix();
         positivePrefixLen = positivePrefix.length();
         negativePrefix = format.getNegativePrefix();
         negativePrefixLen = negativePrefix.length();
         positiveSuffix = format.getPositiveSuffix();
         positiveSuffixLen = positiveSuffix.length();
         negativeSuffix = format.getNegativeSuffix();
         negativeSuffixLen = negativeSuffix.length();
         public DecimalFormat getFormat() {
         return format;
         public Number getNumberValue() throws ParseException {
         try {
         String content = getText(0, getLength());
         parsePos.setIndex(0);
         Number result = format.parse(content, parsePos);
         if (parsePos.getIndex() != getLength()) {
         throw new ParseException("Not a valid number: " + content, 0);
         return result;
         } catch (BadLocationException e) {
         throw new ParseException("Not a valid number", 0);
         public Long getLongValue() throws ParseException {
         Number result = getNumberValue();
         if ((result instanceof Long) == false) {
         throw new ParseException("Not a valid long", 0);
         return (Long) result;
         public Double getDoubleValue() throws ParseException {
         Number result = getNumberValue();
         if ((result instanceof Long) == false
         && (result instanceof Double) == false) {
         throw new ParseException("Not a valid double", 0);
         if (result instanceof Long) {
         result = new Double(result.doubleValue());
         return (Double) result;
         public void insertString(int offset, String str, AttributeSet a)
         throws BadLocationException {
         if (str == null || str.length() == 0) {
         return;
         Content content = getContent();
         int length = content.length();
         int originalLength = length;
         parsePos.setIndex(0);
         // Create the result of inserting the new data,
         // but ignore the trailing newline
         String targetString = content.getString(0, offset) + str
         + content.getString(offset, length - offset - 1);
         // Parse the input string and check for errors
         do {
         boolean gotPositive = targetString.startsWith(positivePrefix);
         boolean gotNegative = targetString.startsWith(negativePrefix);
         length = targetString.length();
         // If we have a valid prefix, the parse fails if the
         // suffix is not present and the error is reported
         // at index 0. So, we need to add the appropriate
         // suffix if it is not present at this point.
         if (gotPositive == true || gotNegative == true) {
         String suffix;
         int suffixLength;
         int prefixLength;
         if (gotPositive == true && gotNegative == true) {
         // This happens if one is the leading part of
         // the other - e.g. if one is "(" and the other "(("
         if (positivePrefixLen > negativePrefixLen) {
         gotNegative = false;
         } else {
         gotPositive = false;
         if (gotPositive == true) {
         suffix = positiveSuffix;
         suffixLength = positiveSuffixLen;
         prefixLength = positivePrefixLen;
         } else {
         // Must have the negative prefix
         suffix = negativeSuffix;
         suffixLength = negativeSuffixLen;
         prefixLength = negativePrefixLen;
         // If the string consists of the prefix alone,
         // do nothing, or the result won't parse.
         if (length == prefixLength) {
         break;
         // We can't just add the suffix, because part of it
         // may already be there. For example, suppose the
         // negative prefix is "(" and the negative suffix is
         // "$)". If the user has typed "(345$", then it is not
         // correct to add "$)". Instead, only the missing part
         // should be added, in this case ")".
         if (targetString.endsWith(suffix) == false) {
         int i;
         for (i = suffixLength - 1; i > 0; i--) {
         if (targetString
         .regionMatches(length - i, suffix, 0, i)) {
         targetString += suffix.substring(i);
         break;
         if (i == 0) {
         // None of the suffix was present
         targetString += suffix;
         length = targetString.length();
         format.parse(targetString, parsePos);
         int endIndex = parsePos.getIndex();
         if (endIndex == length) {
         break; // Number is acceptable
         // Parse ended early
         // Since incomplete numbers don't always parse, try
         // to work out what went wrong.
         // First check for an incomplete positive prefix
         if (positivePrefixLen > 0 && endIndex < positivePrefixLen
         && length <= positivePrefixLen
         && targetString.regionMatches(0, positivePrefix, 0, length)) {
         break; // Accept for now
         // Next check for an incomplete negative prefix
         if (negativePrefixLen > 0 && endIndex < negativePrefixLen
         && length <= negativePrefixLen
         && targetString.regionMatches(0, negativePrefix, 0, length)) {
         break; // Accept for now
         // Allow a number that ends with the group
         // or decimal separator, if these are in use
         char lastChar = targetString.charAt(originalLength - 1);
         int decimalIndex = targetString.indexOf(decimalSeparator);
         if (format.isGroupingUsed() && lastChar == groupingSeparator
         && decimalIndex == -1) {
         // Allow a "," but only in integer part
         break;
         if (format.isParseIntegerOnly() == false
         && lastChar == decimalSeparator
         && decimalIndex == originalLength - 1) {
         // Allow a ".", but only one
         break;
         // No more corrections to make: must be an error
         if (errorListener != null) {
         errorListener.insertFailed(this, offset, str, a);
         return;
         } while (true == false);
         // Finally, add to the model
         super.insertString(offset, str, a);
         public void addInsertErrorListener(InsertErrorListener l) {
         if (errorListener == null) {
         errorListener = l;
         return;
         throw new IllegalArgumentException(
         "InsertErrorListener already registered");
         public void removeInsertErrorListener(InsertErrorListener l) {
         if (errorListener == l) {
         errorListener = null;
         public interface InsertErrorListener {
         public abstract void insertFailed(NumericPlainDocument doc, int offset,
         String str, AttributeSet a);
         protected InsertErrorListener errorListener;
         protected DecimalFormat format;
         protected char decimalSeparator;
         protected char groupingSeparator;
         protected String positivePrefix;
         protected String negativePrefix;
         protected int positivePrefixLen;
         protected int negativePrefixLen;
         protected String positiveSuffix;
         protected String negativeSuffix;
         protected int positiveSuffixLen;
         protected int negativeSuffixLen;
         protected ParsePosition parsePos = new ParsePosition(0);
         protected static DecimalFormat defaultFormat = new DecimalFormat();
    this is not working as desired pls help me.
    can we use this code and get the desired result or is there any other way to do this.
    it is very urgent for me pls help immediately
    thanks in advance

    Hi camickr
    i learned how to format the code now, and u also responded for my testarea problem , iam very much thankful to u, and now i repeat the same problem what i have with a text field.
    actually i have window with a textfield on it and while end user starts entering data in it , it should be have as follows
    when the user start typing numerics it should accept from right hand side and keep appending value from right hand side.
    first the default value should be as 0.00 and as the user starts entering
    then it is as follows
    for ex
    if i want to enter 123.45
    user starts entering
    1 then it should display as 0.01
    2 then it should display as 0.12
    3 then it should display as 1.23
    4 then it should display as 12.34
    5 then it should display as 123.45
    i hope u will give me quick reply because this is very hard time for me.

  • Inline functions in C, gcc optimization and floating point arithmetic issues

    For several days I really have become a fan of Alchemy. But after intensive testing I have found several issues which I'd like to solve but I can't without any help.
    So...I'm porting an old game console emulator written by me in ANSI C. The code is working on both gcc and VisualStudio without any modification or crosscompile macros. The only platform code is the audio and video output which is out of scope, because I have ported audio and video witin AS3.
    Here are the issues:
    1. Inline functions - Having only a single inline function makes the code working incorrectly (although not crashing) even if any optimization is enabled or not (-O0 or O3). My current workarround is converting the inline functions to macros which achieves the same effect. Any ideas why inline functions break the code?
    2. Compiler optimizations - well, my project consists of many C files one of which is called flash.c and it contains the main and exported functions. I build the project as follows:
    gcc -c flash.c -O0 -o flash.o     //Please note the -O0 option!!!
    gcc -c file1.c -O3 -o file1.o
    gcc -c file2.c -O3 -o file2.o
    ... and so on
    gcc *.o -swc -O0 -o emu.swc   //Please note the -O0 option again!!!
    mxmlc.exe -library-path+=emu.swc --target-player=10.0.0 Emu.as
    or file in $( ls *.o ) //Removes the obj files
        do
            rm $file
        done
    If I define any option different from -O0 in gcc -c flash.c -O0 -o flash.o the program stops working correctly exactly as in the inline funtions code (but still does not crash or prints any errors in debug). flash has 4 static functions to be exported to AS3 and the main function. Do you know why?
    If I define any option different from -O0 in gcc *.o -swc -O0 -o emu.swc  the program stops working correctly exactly as above, but if I specify -O1, -O2 or O3 the SWC file gets smaller up to 2x for O3. Why? Is there a method to optimize all the obj files except flash.o because I suspect a similar issue as when compilling it?
    3. Flating point issues - this is the worst one. My code is mainly based on integer arithmetic but on 1-2 places it requires flating point arithmetic. One of them is the conversion of 16-bit 44.1 Khz sound buffer to a float buffer with same sample rate but with samples in the range from -1.0 to 1.0.
    My code:
    void audio_prepare_as()
        uint32 i;
        for(i=0;i<audioSamples;i+=2)
            audiobuffer[i] = (float)snd.buffer[i]/32768;
            audiobuffer[i+1] = (float)snd.buffer[i+1]/32768;
    My audio playback is working perfectly. But not if using the above conversion and I have inspected the float numbers - all incorrect and invalid. I tried other code with simple floats - same story. As if alchemy refuses to work with floats. What is wrong? I have another lace whre I must resize the framebuffer and there I have a float involved - same crap. Please help me?
    Found the floating point problem: audiobuffer is written to a ByteArray and then used in AS. But C floats are obviously not the same as those in AS3. Now the floating point is resolved.
    The optimization issues remain! I really need to speed up my code.
    Thank you in advice!

    Dear Bernd,
    I am still unable to run the optimizations and turn on the inline functions. None of the inline functions contain any stdli function just pure asignments, reads, simple arithmetic and bitwise operations.
    In fact, the file containing the main function and those functions for export in AS3 did have memset and memcpy. I tried your suggestion and put the code above the functions calling memset and memcpy. It did not work soe I put the code in a header which is included topmost in each C file. The only system header I use is malloc.h and it is included topmost. In other C file I use pow, sin and log10 from math.h but I removed it and made the same thing:
    //shared.h
    #ifndef _SHARED_H_
    #define _SHARED_H_
    #include <malloc.h>
    static void * custom_memmove( void * destination, const void * source, unsigned int num ) {
      void *result; 
      __asm__("%0 memmove(%1, %2, %3)\n" : "=r"(result) : "r"(destination), "r"(source), "r"(num)); 
      return result; 
    static void * custom_memcpy ( void * destination, const void * source, unsigned int num ) { 
      void *result; 
      __asm__("%0 memcpy(%1, %2, %3)\n" : "=r"(result) : "r"(destination), "r"(source), "r"(num)); 
      return result; 
    static void * custom_memset ( void * ptr, int value, unsigned int num ) { 
      void *result; 
      __asm__("%0 memset(%1, %2, %3)\n" : "=r"(result) : "r"(ptr), "r"(value), "r"(num)); 
      return result; 
    static float custom_pow(float x, int y) {
        float result;
      __asm__("%0 pow(%1, %2)\n" : "=r"(result) : "r"(x), "r"(y));
      return result;
    static double custom_sin(double x) {
        double result;
      __asm__("%0 sin(%1)\n" : "=r"(result) : "r"(x));
      return result;
    static double custom_log10(double x) {
        double result;
      __asm__("%0 log10(%1)\n" : "=r"(result) : "r"(x));
      return result;
    #define memmove custom_memmove
    #define memcpy custom_memcpy
    #define memset custom_memset
    #define pow custom_pow
    #define sin custom_sin
    #define log10 custom_log10 
    #include "types.h"
    #include "macros.h"
    #include "m68k.h"
    #include "z80.h"
    #include "genesis.h"
    #include "vdp.h"
    #include "render.h"
    #include "mem68k.h"
    #include "memz80.h"
    #include "membnk.h"
    #include "memvdp.h"
    #include "system.h"
    #include "loadrom.h"
    #include "input.h"
    #include "io.h"
    #include "sound.h"
    #include "fm.h"
    #include "sn76496.h" 
    #endif /* _SHARED_H_ */ 
    It still behave the same way as if nothing was changed (works incorrectly - displays jerk which does not move, whereby the image is supposed to move)
    As I am porting an emulator (Sega Mega Drive) I use manu arrays of function pointers for implementing the opcodes of the CPU's. Could this be an issue?
    I did a workaround for the floating point problem but processing is very slow so I hear only bzzt bzzt but this is for now out of scope. The emulator compiled with gcc runs at 300 fps on a 1.3 GHz machine, whereby my non optimized AVM2 code compiled by alchemy produces 14 fps. The pure rendering is super fast and the problem lies in the computational power of AVM. The frame buffer and the enulation are generated in the C code and only the pixels are copied to AS3, where they are plotted in a BitmapData. On 2.0 GHz Dual core I achieved only 21 fps. Goal is 60 fps to have smooth audio and video. But this is offtopic. After all everything works (slow) without optimization, and I would somehow turn it on. Suggestions?
    Here is the file with the main function:
    #include "shared.h"
    #include "AS3.h"
    #define FRAMEBUFFER_LENGTH    (320*240*4)
    static uint8* framebuffer;
    static uint32  audioSamples;
    AS3_Val sega_rom(void* self, AS3_Val args)
        int size, offset, i;
        uint8 hardware;
        uint8 country;
        uint8 header[0x200];
        uint8 *ptr;
        AS3_Val length;
        AS3_Val ba;
        AS3_ArrayValue(args, "AS3ValType", &ba);
        country = 0;
        offset = 0;
        length = AS3_GetS(ba, "length");
        size = AS3_IntValue(length);
        ptr = (uint8*)malloc(size);
        AS3_SetS(ba, "position", AS3_Int(0));
        AS3_ByteArray_readBytes(ptr, ba, size);
        //FILE* f = fopen("boris_dump.bin", "wb");
        //fwrite(ptr, size, 1, f);
        //fclose(f);
        if((size / 512) & 1)
            size -= 512;
            offset += 512;
            memcpy(header, ptr, 512);
            for(i = 0; i < (size / 0x4000); i += 1)
                deinterleave_block(ptr + offset + (i * 0x4000));
        memset(cart_rom, 0, 0x400000);
        if(size > 0x400000) size = 0x400000;
        memcpy(cart_rom, ptr + offset, size);
        /* Free allocated file data */
        free(ptr);
        hardware = 0;
        for (i = 0x1f0; i < 0x1ff; i++)
            switch (cart_rom[i]) {
         case 'U':
             hardware |= 4;
             break;
         case 'J':
             hardware |= 1;
             break;
         case 'E':
             hardware |= 8;
             break;
        if (cart_rom[0x1f0] >= '1' && cart_rom[0x1f0] <= '9') {
            hardware = cart_rom[0x1f0] - '0';
        } else if (cart_rom[0x1f0] >= 'A' && cart_rom[0x1f0] <= 'F') {
            hardware = cart_rom[0x1f0] - 'A' + 10;
        if (country) hardware=country; //simple autodetect override
        //From PicoDrive
        if (hardware&8)        
            hw=0xc0; vdp_pal=1;
        } // Europe
        else if (hardware&4)    
            hw=0x80; vdp_pal=0;
        } // USA
        else if (hardware&2)    
            hw=0x40; vdp_pal=1;
        } // Japan PAL
        else if (hardware&1)      
            hw=0x00; vdp_pal=0;
        } // Japan NTSC
        else
            hw=0x80; // USA
        if (vdp_pal) {
            vdp_rate = 50;
            lines_per_frame = 312;
        } else {
            vdp_rate = 60;
            lines_per_frame = 262;
        /*SRAM*/   
        if(cart_rom[0x1b1] == 'A' && cart_rom[0x1b0] == 'R')
            save_start = cart_rom[0x1b4] << 24 | cart_rom[0x1b5] << 16 |
                cart_rom[0x1b6] << 8  | cart_rom[0x1b7] << 0;
            save_len = cart_rom[0x1b8] << 24 | cart_rom[0x1b9] << 16 |
                cart_rom[0x1ba] << 8  | cart_rom[0x1bb] << 0;
            // Make sure start is even, end is odd, for alignment
            // A ROM that I came across had the start and end bytes of
            // the save ram the same and wouldn't work.  Fix this as seen
            // fit, I know it could probably use some work. [PKH]
            if(save_start != save_len)
                if(save_start & 1) --save_start;
                if(!(save_len & 1)) ++save_len;
                save_len -= (save_start - 1);
                saveram = (unsigned char*)malloc(save_len);
                // If save RAM does not overlap main ROM, set it active by default since
                // a few games can't manage to properly switch it on/off.
                if(save_start >= (unsigned)size)
                    save_active = 1;
            else
                save_start = save_len = 0;
                saveram = NULL;
        else
            save_start = save_len = 0;
            saveram = NULL;
        return AS3_Int(0);
    AS3_Val sega_init(void* self, AS3_Val args)
        system_init();
        audioSamples = (44100 / vdp_rate)*2;
        framebuffer = (uint8*)malloc(FRAMEBUFFER_LENGTH);
        return AS3_Int(vdp_rate);
    AS3_Val sega_reset(void* self, AS3_Val args)
        system_reset();
        return AS3_Int(0);
    AS3_Val sega_frame(void* self, AS3_Val args)
        uint32 width;
        uint32 height;
        uint32 x, y;
        uint32 di, si, r;
        uint16 p;
        AS3_Val fb_ba;
        AS3_ArrayValue(args, "AS3ValType", &fb_ba);
        system_frame(0);
        AS3_SetS(fb_ba, "position", AS3_Int(0));
        width = (reg[12] & 1) ? 320 : 256;
        height = (reg[1] & 8) ? 240 : 224;
        for(y=0;y<240;y++)
            for(x=0;x<320;x++)
                di = 1280*y + x<<2;
                si = (y << 10) + ((x + bitmap.viewport.x) << 1);
                p = *((uint16*)(bitmap.data + si));
                framebuffer[di + 3] = (uint8)((p & 0x1f) << 3);
                framebuffer[di + 2] = (uint8)(((p >> 5) & 0x1f) << 3);
                framebuffer[di + 1] = (uint8)(((p >> 10) & 0x1f) << 3);
        AS3_ByteArray_writeBytes(fb_ba, framebuffer, FRAMEBUFFER_LENGTH);
        AS3_SetS(fb_ba, "position", AS3_Int(0));
        r = (width << 16) | height;
        return AS3_Int(r);
    AS3_Val sega_audio(void* self, AS3_Val args)
        AS3_Val ab_ba;
        AS3_ArrayValue(args, "AS3ValType", &ab_ba);
        AS3_SetS(ab_ba, "position", AS3_Int(0));
        AS3_ByteArray_writeBytes(ab_ba, snd.buffer, audioSamples*sizeof(int16));
        AS3_SetS(ab_ba, "position", AS3_Int(0));
        return AS3_Int(0);
    int main()
        AS3_Val romMethod = AS3_Function(NULL, sega_rom);
        AS3_Val initMethod = AS3_Function(NULL, sega_init);
        AS3_Val resetMethod = AS3_Function(NULL, sega_reset);
        AS3_Val frameMethod = AS3_Function(NULL, sega_frame);
        AS3_Val audioMethod = AS3_Function(NULL, sega_audio);
        // construct an object that holds references to the functions
        AS3_Val result = AS3_Object("sega_rom: AS3ValType, sega_init: AS3ValType, sega_reset: AS3ValType, sega_frame: AS3ValType, sega_audio: AS3ValType",
            romMethod, initMethod, resetMethod, frameMethod, audioMethod);
        // Release
        AS3_Release(romMethod);
        AS3_Release(initMethod);
        AS3_Release(resetMethod);
        AS3_Release(frameMethod);
        AS3_Release(audioMethod);
        // notify that we initialized -- THIS DOES NOT RETURN!
        AS3_LibInit(result);
        // should never get here!
        return 0;

  • Issues in Simple Data Type - Float

    Hi SDN,
    I have created a simple data type of float and assigned to a context attribute. I have mentioned that  the minimum and maximum inclusive value for the float as 0.1 and 29.9. This is assigned to a field aaa. When the page loads for the first time, there appears 0 by default and if I dont edit the field and try saving, it doesnt throw any error message. It accepts the value which was very strange to me. But if I edit the value and put as 0.0, it throws error message saying, the acceptable value for the field is between 0.1 and 29.9.
    What should I do to resolve this issue? Also Can I make the field empty instead of a zero appearing the field?
    Regards,
    Ganesh N

    Hello Ganesh,
    Whatever the value you have provided only that values are allowed in that input field. if the value is 0 or 0.0 you can validate that attribute and throw an error message that "The Value should not be 0".
    Regards
    Nizamudeen SM

  • CSS issues - centering divs, floats, & margins

    OK,
    Have my CSS with wrapper....several different divs. My issue
    was centering a div, then centering a div below it, so I used
    margin-left:auto and margin-right:auto. I also have another div
    that SHOULD reside on the right side of the page, however, it has a
    float:right, so I know that the auto margins will push the right
    floated div below where I want it to reside.
    Here's the CSS code:
    html,body {
    margin-left: 0px;
    margin-right: 0px;
    background:;
    #wrapper {
    font-family:Georgia, Times New Roman, Times, serif;
    font-size: 14px;
    font-style: normal;
    line-height: normal;
    color: #000000;
    height: px;
    width: 760px;
    left:50%;
    top:75px;
    margin:0 auto 0 auto;
    #toprule {
    float:left;
    width: 725px;
    padding-left:15.5px;
    padding-right:15.5px;
    height: 6px;
    border:#00000;
    border-style:solid;
    background:none;
    #leftrule {
    float:left;
    width: 6px;
    height: 600px;
    border:#000000;
    border-style:solid;
    border-size:1px;
    background:none;
    margin-top: 75px;
    #topbanner
    width: 686px;
    height: 136px;
    margin-left:auto;
    margin-right:auto;
    margin-top:25px;
    border:#000000;
    border-style:solid;
    border-size:1px;
    background:#000000;
    #rightrule
    float:right;
    width: 6px;
    height: 600px;
    margin-top:75px;
    border:#000000;
    border-style:solid;
    border-size:1px;
    background:none;
    #topmenu
    width: 623px;
    height: 26px;
    margin-left:auto;
    margin-right:auto;
    border:#000000;
    border-style:solid;
    border-size:1px;
    background:none;
    #lowermenu
    float:left;
    width: 325px;
    height: 124px;
    margin-top:30px;
    margin-left:40px;
    border:#000000;
    border-style:solid;
    border-size:1px;
    background:none;
    #images
    float:right;
    width: 306px;
    height: 306px;
    border:#000000;
    margin-top:30px;
    margin-right:30px;
    border-style:solid;
    border-size:1px;
    background: none;
    #content
    float:left;
    width:325px;
    height:177px;
    margin-left:40px;
    margin-top:15px;
    border:#000000;
    borderstyle:solid;
    border-size:1px;
    background:none
    #footer
    width: 686px;
    height: 73px;
    border:#000000;
    margin-top:15px;
    margin-left:auto;
    margin-right:auto;
    border-style:solid;
    border-size:1px;
    background:none;
    and the HTML code
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=utf-8" />
    <title>Welcome to EB's Food</title>
    <link href="ebsfoods.css" rel="stylesheet" type="text/css"
    />
    </head>
    <body>
    <div id="wrapper">
    <div id="toprule"></div>
    </div>
    <div id="leftrule">leftrule</div>
    <div id="topbanner">topbanner</div>
    <div id="rightrule">rightrule</div>
    <div id="topmenu">
    <div align="left">topmenu</div>
    </div>
    <div id="lowermenu">lowermenu</div>
    <div id="images">images</div>
    <div id="content">content</div>
    <div id="footer">footer</div>
    </body>
    </html>
    Assistance greatly appreciated.......
    David Bird
    BTW,
    The "lowermenu" and "content" are supposed to line up with
    the left edge of the "topbanner" and the "images" is supposed to
    line up with the right edge of the "topbanner". The footer is the
    same size as the topbanner and is supposed to be centered.
    db

    This is a bit confused, as is your CSS. What is it you are
    trying to
    accomplish?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "mobirdman" <[email protected]> wrote in
    message
    news:[email protected]...
    > OK,
    > Have my CSS with wrapper....several different divs. My
    issue was centering
    > a
    > div, then centering a div below it, so I used
    margin-left:auto and
    > margin-right:auto. I also have another div that SHOULD
    reside on the right
    > side
    > of the page, however, it has a float:right, so I know
    that the auto
    > margins
    > will push the right floated div below where I want it to
    reside.
    >
    > Here's the CSS code:
    >
    > html,body {
    >
    > margin-left: 0px;
    > margin-right: 0px;
    > background:;
    > }
    >
    > #wrapper {
    > font-family:Georgia, Times New Roman, Times, serif;
    > font-size: 14px;
    > font-style: normal;
    > line-height: normal;
    > color: #000000;
    > height: px;
    > width: 760px;
    > left:50%;
    > top:75px;
    > margin:0 auto 0 auto;
    >
    > }
    >
    > #toprule {
    > float:left;
    > width: 725px;
    > padding-left:15.5px;
    > padding-right:15.5px;
    > height: 6px;
    > border:#00000;
    > border-style:solid;
    > background:none;
    > }
    >
    > #leftrule {
    > float:left;
    > width: 6px;
    > height: 600px;
    > border:#000000;
    > border-style:solid;
    > border-size:1px;
    > background:none;
    > margin-top: 75px;
    > }
    >
    > #topbanner
    > {
    >
    > width: 686px;
    > height: 136px;
    > margin-left:auto;
    > margin-right:auto;
    > margin-top:25px;
    > border:#000000;
    > border-style:solid;
    > border-size:1px;
    > background:#000000;
    >
    >
    > }
    >
    > #rightrule
    > {
    > float:right;
    > width: 6px;
    > height: 600px;
    > margin-top:75px;
    > border:#000000;
    > border-style:solid;
    > border-size:1px;
    > background:none;
    > }
    >
    > #topmenu
    > {
    >
    > width: 623px;
    > height: 26px;
    > margin-left:auto;
    > margin-right:auto;
    > border:#000000;
    > border-style:solid;
    > border-size:1px;
    > background:none;
    > }
    >
    > #lowermenu
    > {
    > float:left;
    > width: 325px;
    > height: 124px;
    > margin-top:30px;
    > margin-left:40px;
    > border:#000000;
    > border-style:solid;
    > border-size:1px;
    > background:none;
    > }
    >
    > #images
    > {
    > float:right;
    > width: 306px;
    > height: 306px;
    > border:#000000;
    > margin-top:30px;
    > margin-right:30px;
    > border-style:solid;
    > border-size:1px;
    > background: none;
    > }
    >
    > #content
    > {
    > float:left;
    > width:325px;
    > height:177px;
    > margin-left:40px;
    > margin-top:15px;
    > border:#000000;
    > borderstyle:solid;
    > border-size:1px;
    > background:none
    > }
    >
    > #footer
    >
    > {
    >
    > width: 686px;
    > height: 73px;
    > border:#000000;
    > margin-top:15px;
    > margin-left:auto;
    > margin-right:auto;
    > border-style:solid;
    > border-size:1px;
    > background:none;
    >
    > and the HTML code
    >
    > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN"
    > "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    > <html xmlns="
    http://www.w3.org/1999/xhtml">
    > <head>
    > <meta http-equiv="Content-Type" content="text/html;
    charset=utf-8" />
    > <title>Welcome to EB's Food</title>
    > <link href="ebsfoods.css" rel="stylesheet"
    type="text/css" />
    > </head>
    >
    > <body>
    > <div id="wrapper">
    > <div id="toprule"></div>
    >
    > </div>
    > <div id="leftrule">leftrule</div>
    > <div id="topbanner">topbanner</div>
    > <div id="rightrule">rightrule</div>
    > <div id="topmenu">
    > <div align="left">topmenu</div>
    > </div>
    > <div id="lowermenu">lowermenu</div>
    > <div id="images">images</div>
    > <div id="content">content</div>
    > <div id="footer">footer</div>
    > </body>
    > </html>
    >
    > Assistance greatly appreciated.......
    >
    > David Bird
    >

Maybe you are looking for

  • How to get rid of the black border around the artboard

    Hopefully my last question for tonight. I need to get rid of the black border around the artboard. The two images show my drawing lined up with the art board and then inside the artboard. The dark gray is not the artboard. As you see, the artboard ha

  • Issue with the last column stretching in ADF table

    There is an issue wherein when  I try stretching the last column of the ADF table to reduce its width it does stretch. But whenever I try stretching it back to this original position it doesn't despite having columnstretching attribute set to multipl

  • Wow the new firmware has made a mess of my Touch, Creative please resp

    Okay, first I find out that some of my music is missing track number tags and is now listed in alpabetical order. Next, Media Source doesnt detect my Touch at all, so I have no easy way to fix my tags. So I have to move the music off my player, tag i

  • Error Occured while rendering portlet :see provider log for details

    Hi All, I have installed OAS 10.1.3.1 on RHEL 5.4 64 bit m/c when after deploying the application when i tried to access the application through portlet i am getting the following error Error Occured while rendering portlet :see provider log for deta

  • Passing parameters to subroutine

    Hi, I have a subroutine which is being called from the 2 PAI modules of the different screens.The subroutine has two queries which are the same for both the modules , the only difference I want is that after the queries there is a call to a new scree