"Sputnik" help  
Sputnik Help
Printf

Description

 

Parameters

   

Return Value

Success: Returns true.
Failure: Returns false.

Remarks

Go read the Printf Reference to learn all the formatting features for this function.

Related

Example

An example of creating a chat using printf:

Function FormatName($userName, $opts = 0)
{
    return Sprintf($opts == 1 ? "\r *** %s " : "\r%13.13s:  ", $userName);
}
Function FormatChat($userName, $message, $opts = 0)
{
    using (my $sb = new StringBuilder())
    {
        my $name = FormatName($userName, $opts);
        my $lines = Lines($message);
        foreach (my $line in $lines)
        {
            my $lineTrim = Trim($line);
            if (StrLen($lineTrim) <= 0)
                continue;
            $sb->Append($name);
            $sb->Append($line);
        }
        my $finalMsg = $sb->ToString();
        return $finalMsg;
    }
}

say FormatChat("UberFoX", "Hello world!");
say FormatChat("FlyingChicken", "Hello world!");
say FormatChat("The quickest moo moo farm", "Hello world!");
say FormatChat("UberFoX", "waves to all", 1);
say FormatChat("UberFoX", "The Art of Sput");

// PRINTS
//       UberFoX:  Hello world!
// FlyingChicken:  Hello world!
// The quickest :  Hello world!
//  *** UberFoX waves to all
//       UberFoX:  The Art of Sput
The FormatName and FormatChat functions can be found in the <String.spk> include.

Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org