Mimics the C sprintf API, putting the data into the string. The arguments are the format string and the arguments are listed in the format string. printform uses the same formatting as the C sprintf API.
format(string printform, args);
Parameter |
Description |
---|---|
printform |
Print formatting.This string should be in the format of C language sprintf strings, with parameter characters preceded by a percentage character (%). |
args |
Any arguments called for in the printform. If the character is a control character, it must be in either local or hexidecimal format. |
Integer. Returns 1 for success, and 0 for failure.
Pointer to object |
Object |
---|---|
|
|
|
|
The format string has 3 arguments: a decimal with 2 places, a decimal with 1 place, and an unlimited decimal. The object would hold “3.66 times 3.5 = 12.81”.
mystring.format (“%.2d times %.1d = %i”, a,3.5, a*3.50);
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |