InputVariations

Kind of class:class
Inherits from:none
Version:1.2, 16 March 2005
Author:Arthur Clemens
Classpath:InputVariations
File last modified:Wednesday, 05 March 2008, 22:51:40
Example of messy use of block tags with and without leading space and star.
Note the example code block: you can use either code or pre to write a code example. When a code text spans multiple lines, the text is automatically wrapped inside <pre></pre> tags.
Tabs before code fragments are cleaned up so that the code always lines up to the left (see getDaysSinceNow below).
Example:
  • Code within code tags that spans multiple lines is converted to <pre></pre>
    var r = 10.0;
    var d = Math.PI * r;
    recalculateBounds(d);
    
        // Example with indented code.
        target.onReady = function ()
        {
            loadMovie("http://www.mysite.com/mymovie.swf");
        }

    Same code within <pre> tags - renders identical:
    var r = 10.0;
    var d = Math.PI * r;
    recalculateBounds(d);
    
        // Example with indented code.
        target.onReady = function ()
        {
            loadMovie("http://www.mysite.com/mymovie.swf");
        }

    Code with stars:
    var r = 10.0;
    var d = Math.PI * r;
    recalculateBounds(d);
    
        // Example with indented code.
        target.onReady = function ()
        {
            loadMovie("http://www.mysite.com/mymovie.swf");
        }

    Same code but within <blockquote><pre> tags:
    var r = 10.0;
    var d = Math.PI * r;
    recalculateBounds(d);
    
        // Example with indented code.
        target.onReady = function ()
        {
            loadMovie("http://www.mysite.com/mymovie.swf");
        }

    Some code inside wrong tags: <code></pre>
    This text is inside wrong tags
    Some more code inside wrong tags: <pre></code>
    This text is inside wrong tags
Usage:
  • With the following xml file:
    <?xml version="1.0" encoding="utf-8" ?> 
    <days>
        <subscription>8-8-2004</subscription>
    </days>


    This is text with code inside a div:
    var r = 10.0;
    var d = Math.PI * r;
    recalculateBounds(d);
    
        // Example with indented code.
        target.onReady = function ()
        {
            loadMovie("http://www.mysite.com/mymovie.swf");
        }

Summary


Class methods

Class methods

getDaysSinceNow

static function getDaysSinceNow (
inDate:Date) : Number

Usage:
  • var daysPassed:Number = DateUtils.getDaysSinceNow( myOtherDateObj );
    comment line 1
    comment line 2
    comment line 3
    These lines will only be written on separate lines if the option "Preserve linebreaks" is selected. Otherwise use <br /> to create a new line.

sameMethodWithoutStars

static function sameMethodWithoutStars (
inDate:Date) : Number

Usage:
  • var daysPassed:Number = DateUtils.getDaysSinceNow( myOtherDateObj );
    comment line 1
    comment line 2
    comment line 3

sameMethodWithoutStarsWithCodeOnOneLine

static function sameMethodWithoutStarsWithCodeOnOneLine (
inDate:Date) : Number

Usage:
  • var daysPassed:Number = DateUtils.getDaysSinceNow( myOtherDateObj );
    comment line 1
    comment line 2
    comment line 3