How to Right Justify a String in Basic (84065)
The information in this article applies to:
- Microsoft QuickBASIC 4.0
- Microsoft QuickBASIC 4.0b
- Microsoft QuickBASIC 4.5
- Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0
- Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.1
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
- Microsoft Visual Basic Standard Edition for Windows 1.0
- Microsoft Visual Basic for MS-DOS
This article was previously published under Q84065 SUMMARY
There is no command in either QuickBasic or Basic PDS for simple
justification of strings.
The following function returns a string that is right justified. This
string could be used for printing or other tasks.
Note: This function is written to handle numbers of SINGLE precision
type. A change in the FUNCTION statement and DECLARE statement is all
that is required to make it work with different data types. This function could be modified to work with left justification or centering using the same idea used for the right justification.
For information on how to convert a number in scientific notation to
standard notation before or while performing the justification
function, query for the following words in the Microsoft Knowledge
Base:
scientific and notation and REALSTRING$
Modification Type: | Minor | Last Reviewed: | 8/16/2005 |
---|
Keywords: | KB84065 |
---|
|