- •Table of Contents
- •Chapter 1. Introduction
- •Using Commands
- •Batch Program Use
- •How to Use this Manual
- •Chapter 2. Object and Command Basics
- •Object Declaration
- •Object Commands
- •Object Assignment
- •More on Object Declaration
- •Auxiliary Commands
- •Managing Workfiles and Databases
- •Managing Objects
- •Basic Command Summary
- •Chapter 3. Matrix Language
- •Declaring Matrices
- •Assigning Matrix Values
- •Copying Data Between Objects
- •Matrix Expressions
- •Matrix Commands and Functions
- •Matrix Views and Procs
- •Matrix Operations versus Loop Operations
- •Summary of Automatic Resizing of Matrix Objects
- •Matrix Function and Command Summary
- •Chapter 4. Working with Tables
- •Creating a Table
- •Assigning Table Values
- •Customizing Tables
- •Labeling Tables
- •Printing Tables
- •Exporting Tables to Files
- •Customizing Spreadsheet Views
- •Table Summary
- •Chapter 5. Working with Graphs
- •Creating a Graph
- •Changing Graph Types
- •Customizing a Graph
- •Labeling Graphs
- •Printing Graphs
- •Exporting Graphs to Files
- •Graph Summary
- •Chapter 6. EViews Programming
- •Program Basics
- •Simple Programs
- •Program Variables
- •Program Modes
- •Program Arguments
- •Control of Execution
- •Multiple Program Files
- •Subroutines
- •Programming Summary
- •Chapter 7. Strings and Dates
- •Strings
- •Dates
- •Appendix A. Object, View and Procedure Reference
- •Alpha
- •Coef
- •Equation
- •Graph
- •Group
- •Link
- •Logl
- •Matrix
- •Model
- •Pool
- •Rowvector
- •Sample
- •Scalar
- •Series
- •Sspace
- •System
- •Table
- •Text
- •Valmap
- •Vector
- •Appendix B. Command Reference
- •addassign
- •addinit
- •addtext
- •align
- •alpha
- •append
- •arch
- •archtest
- •area
- •arlm
- •arma
- •arroots
- •auto
- •axis
- •bdstest
- •binary
- •block
- •boxplot
- •boxplotby
- •bplabel
- •cause
- •ccopy
- •cdfplot
- •cellipse
- •censored
- •cfetch
- •chdir
- •checkderivs
- •chow
- •clabel
- •cleartext
- •close
- •coef
- •coefcov
- •coint
- •comment
- •control
- •copy
- •correl
- •correlsq
- •count
- •create
- •cross
- •data
- •datelabel
- •dates
- •dbcopy
- •dbcreate
- •dbdelete
- •dbopen
- •dbpack
- •dbrebuild
- •dbrename
- •dbrepair
- •decomp
- •define
- •delete
- •derivs
- •describe
- •displayname
- •draw
- •drawdefault
- •driconvert
- •drop
- •dtable
- •edftest
- •endog
- •equation
- •errbar
- •exclude
- •exit
- •expand
- •fetch
- •fill
- •fiml
- •fixedtest
- •forecast
- •freeze
- •freq
- •frml
- •garch
- •genr
- •grads
- •graph
- •group
- •hconvert
- •hfetch
- •hilo
- •hist
- •hlabel
- •impulse
- •jbera
- •kdensity
- •kerfit
- •label
- •laglen
- •legend
- •line
- •linefit
- •link
- •linkto
- •load
- •logit
- •logl
- •makecoint
- •makederivs
- •makeendog
- •makefilter
- •makegarch
- •makegrads
- •makegraph
- •makegroup
- •makelimits
- •makemap
- •makemodel
- •makeregs
- •makeresids
- •makesignals
- •makestates
- •makestats
- •makesystem
- •matrix
- •means
- •merge
- •metafile
- •model
- •name
- •nnfit
- •open
- •options
- •ordered
- •output
- •override
- •pageappend
- •pagecontract
- •pagecopy
- •pagecreate
- •pagedelete
- •pageload
- •pagerename
- •pagesave
- •pageselect
- •pagestack
- •pagestruct
- •pageunstack
- •param
- •pcomp
- •plot
- •pool
- •predict
- •probit
- •program
- •qqplot
- •qstats
- •range
- •ranhaus
- •read
- •rename
- •representations
- •resample
- •reset
- •residcor
- •residcov
- •resids
- •results
- •rndint
- •rndseed
- •rowvector
- •sample
- •save
- •scalar
- •scale
- •scat
- •scatmat
- •scenario
- •seas
- •seasplot
- •series
- •setbpelem
- •setcell
- •setcolwidth
- •setconvert
- •setelem
- •setfillcolor
- •setfont
- •setformat
- •setheight
- •setindent
- •setjust
- •setline
- •setlines
- •setmerge
- •settextcolor
- •setwidth
- •sheet
- •show
- •signalgraphs
- •smooth
- •smpl
- •solve
- •solveopt
- •sort
- •spec
- •spike
- •sspace
- •statby
- •stategraphs
- •statefinal
- •stateinit
- •stats
- •statusline
- •stom
- •stomna
- •store
- •structure
- •svar
- •system
- •table
- •template
- •testadd
- •testbtw
- •testby
- •testdrop
- •testexog
- •testfit
- •testlags
- •teststat
- •text
- •textdefault
- •trace
- •tramoseats
- •tsls
- •unlink
- •update
- •updatecoefs
- •uroot
- •usage
- •valmap
- •vars
- •vector
- •wald
- •wfcreate
- •wfopen
- •wfsave
- •wfselect
- •white
- •workfile
- •write
- •wtsls
- •xyline
- •xypair
- •Appendix C. Special Expression Reference
- •@expand
- •nrnd
- •Appendix D. Operator and Function Reference
- •Operators
- •Basic Mathematical Functions
- •Time Series Functions
- •Descriptive Statistics
- •By-Group Statistics
- •Special Functions
- •Trigonometric Functions
- •Statistical Distribution Functions
- •Appendix E. Workfile Functions
- •Basic Workfile Information
- •Dated Workfile Information
- •Panel Workfile Functions
- •Appendix F. String and Date Function Reference
- •@dateadd
- •@datediff
- •@datefloor
- •@datepart
- •@datestr
- •@dateval
- •@dtoo
- •@eqna
- •@insert
- •@instr
- •@isempty
- •@left
- •@len, @length
- •@lower
- •@ltrim
- •@makedate
- •@neqna
- •@otod
- •@replace
- •@right
- •@rtrim
- •@strdate
- •@strlen
- •@strnow
- •@trim
- •@upper
- •Appendix G. Matrix Reference
- •@cholesky
- •colplace
- •@columnextract
- •@columns
- •@cond
- •@convert
- •@eigenvalues
- •@eigenvectors
- •@explode
- •@filledmatrix
- •@filledrowvector
- •@filledsym
- •@filledvector
- •@getmaindiagonal
- •@identity
- •@implode
- •@inner
- •@inverse
- •@issingular
- •@kronecker
- •@makediagonal
- •matplace
- •mtos
- •@norm
- •@outer
- •@permute
- •@rank
- •@resample
- •@rowextract
- •rowplace
- •@rows
- •@solvesystem
- •stom
- •stomna
- •@subextract
- •@trace
- •@transpose
- •@unitvector
- •@vech
- •Appendix H. Programming Language Reference
- •call
- •@date
- •else
- •endif
- •endsub
- •@errorcount
- •@evpath
- •exitloop
- •include
- •@isobject
- •next
- •open
- •output
- •poff
- •program
- •return
- •statusline
- •step
- •stop
- •subroutine
- •@temppath
- •then
- •@time
- •wend
- •while
- •Index
- •Symbols
- •% (percent sign)
- •+ (plus)
- •addition 35
- •@crossid 593
- •@date 148, 590, 633
- •@eqna 124, 575, 599
- •@-functions
- •@inner 578, 619
- •@insert 126, 600
- •@instr 124, 600
- •@inverse 620
- •@isempty 124, 601
- •@isna 575
- •@isobject 637
- •@isperiod 591
- •@issingular 620
- •@kronecker 620
- •@kurtsby 580
- •@last 474
- •@lastmax 474
- •@lastmin 474
- •@left 125, 601, 606
- •@length 124, 602
- •@logit 583
- •@logx 576
- •@lower 127, 602
- •@ltrim 126, 602
- •@makedate 142, 603
- •@makediagonal 621
- •@maxsby 579
- •@meansby 579
- •@median 578
- •@mediansby 579
- •@minsby 579
- •@month 148, 591
- •@movav 576
- •@movsum 576
- •@nasby 580
- •@neqna 125, 575, 604
- •@ngroups 580
- •@norm 623
- •@obsby 579
- •@obsid 593
- •@obsnum 589
- •@obsrange 590
- •@obssmpl 590
- •@otod 128, 605
- •@outer 623
- •@pcha 577
- •@pchy 577
- •@permute 624
- •@quantile 579
- •@quantilesby 580
- •@quarter 148, 591
- •@rank 624
- •@recode 576
- •@replace 126, 605
- •@resample 625
- •@RGB specification of colors 454
- •@right 126
- •@round 576
- •@rowextract 625
- •@rows 626
- •@rtrim 126, 606
- •@seas 591
- •@skewsby 580
- •@solvesystem 626
- •@sqrt 576
- •@stdev 579
- •@stdevsby 579
- •@strdate 128, 148, 591, 607
- •@strlen 607
- •@strnow 128, 607
- •@subextract 628
- •@sumsby 579
- •@sumsq 579
- •@sumsqsby 579
- •@temppath 641
- •_ (continuation character) 84
- •Numerics
- •Add factor
- •align 203
- •views 154
- •Alpha series
- •append 205
- •ARCH
- •Arguments
- •in programs 98
- •ARMA
- •ASCII file
- •open as workfile 532
- •Autocorrelation
- •Autogressive error. See AR.
- •Autowrap text 83
- •Axis
- •rename label 371
- •axis 217
- •Beta
- •Binary
- •Binomial
- •customize 231
- •Breusch-Godfrey test
- •call 633
- •Cell
- •censored 238
- •Cholesky factor
- •Chow test 241
- •Close
- •Coefficient
- •See Coef.
- •update default coef vector 521
- •Cointegration
- •Color
- •Column
- •extract from matrix 612
- •stack matrix 630
- •Conditional standard deviation
- •Conditional variance
- •Control variable 88
- •Convert
- •date to observation number 599
- •matrix to sym 618
- •Coordinates
- •Copy
- •cross 260
- •matrix 259
- •Create
- •Cross section member
- •of squares 424
- •Data
- •Database
- •Date
- •Dates
- •current date and time 147
- •string representation 598
- •Declare
- •Delete
- •Derivatives
- •Directory
- •Distribution function
- •DRI database
- •fetch series 239
- •Drop
- •group series or cross-section from pool definition 281
- •Eigenvalues 615
- •Element
- •else 634
- •Error correction model
- •Errors
- •exclude 289
- •Exclude variables from model solution 289
- •Exit
- •Exponential
- •Export
- •matrix 41
- •Extract
- •row vector 625
- •Files
- •Fill
- •Filled
- •Fixed effects
- •For loop
- •Forecast
- •Freeze
- •frml 306
- •Full information maximum likelihood 296
- •GARCH
- •Gauss file 532
- •Gaussian distribution 586
- •Generalized autoregressive conditional heteroskedasticity
- •Generate series
- •Gompit models 222
- •Gradients
- •display 315
- •create 59
- •high-low-open-close 320
- •pie graph 406
- •XY graph 556
- •graph 316
- •greater than comparison 36
- •add series 198
- •group 317
- •Hausman test 413
- •hconvert 318
- •HTML
- •If statement 100
- •Include
- •Inverse of matrix 620
- •Jarque-Bera
- •Johansen cointegration test 245
- •Kernel
- •label 330
- •specify as range 643
- •Lagrange multiplier
- •Legend
- •line 334
- •Link object
- •Local
- •Logistic
- •logl 344
- •Loop
- •exit loop 108, 635
- •Lotus file
- •Matrix
- •resample rows from 625
- •matrix 366
- •Maximum 578
- •Median 578
- •Merge
- •Messages
- •model solution 371
- •Model 170
- •Models
- •block structure 223
- •solve 475
- •Multiplication operator (*) 35
- •Negative binomial
- •Number
- •evaluate a string 608
- •Numbers
- •converting from strings 124
- •store 16, 490
- •Open
- •database 266
- •Output
- •Output redirection 638
- •override 382
- •Override variables in model solution 382
- •Page
- •resize 399
- •Panel
- •Panel data
- •Percent change
- •Poisson
- •Pool 171
- •declare 408
- •delete identifiers 272
- •pool 408
- •portrait 8
- •probit 410
- •create 83
- •open 84
- •P-value functions 587
- •QQ-plot
- •Quantile function 579
- •Random effects
- •Random number
- •Read
- •Recode values 576
- •Regressors
- •Rename
- •Resample
- •Residuals
- •Results
- •return 639
- •height 50
- •Run program
- •multiple files 108
- •Sample
- •set current 474
- •Save
- •with kernel fit 329
- •scenario 438
- •seas 440
- •Second moment matrix 619
- •declare 442
- •formula 306
- •show 470
- •Signal variables
- •Singular matrix
- •test for 620
- •Smoothing
- •Solve
- •linear system 626
- •sort 478
- •Sspace
- •declare 482
- •procs 180
- •State space
- •State variables
- •display graphs of 484
- •Static forecast 297
- •insert string into 600
- •relational comparison 121
- •String variable 89
- •in for loop 104
- •return from 109, 639
- •Symmetric matrix
- •declare 497
- •Table 187
- •text color 54
- •Test
- •Chow 241
- •for ARCH 210
- •mean, median, variance equality 501
- •mean, median, variance equality by classification 502
- •Text file
- •Then 642
- •Time
- •current as string 607
- •trace 512
- •Trigonometric functions 583
- •Uniform distribution 587
- •Valmap 189
- •vector 529
- •Verbose mode 85
- •append contents of workfile page to current page 383
- •close 12
- •contract page 385
- •create 260
- •end date of observation interval 590
- •open existing 12, 532
- •period indicators 591
- •save 12, 540
- •stack page 396
- •Write
- •wtsls 547
- •xypair 561
setfillcolor—453
graph1.setelem(1) lcolor(blue)
graph1.setelem(1) linecolor(0, 0, 255)
are equivalent methods of setting the linecolor to blue.
graph1.setelem(1) fillgray(6)
sets the gray-scale color for the first graph element.
The lines:
graph1.setelem(1) scale(l)
graph1.setelem(2) scale(l)
graph1.setelem(3) scale(r)
create a dual scale graph where the first two series are scaled together and labeled on the left axis, and the third series is scaled and labeled on the right axis.
graph1.setelem(2) legend("gross domestic product")
sets the legend for the second graph element.
Cross-references
See Chapter 14, “Graphs, Tables, and Text Objects”, on page 413 of the User’s Guide for a discussion of graph options in EViews.
See also axis (p. 217), datelabel (p. 262), scale (p. 433) and options (p. 375).
setfillcolor |
Table Proc |
|
|
Set the fill (background) color of the specified table cells.
Syntax
Table Proc: |
table_name.setfillcolor(cell_range) color_arg |
where cell_range can take one of the following forms:
@all |
Apply to all cells in the table. |
|
|
cell |
Cell identifier. You can identify cells using either the |
|
column letter and row number (e.g., “A1”), or by using |
|
“R” followed by the row number followed by “C” and |
|
the column number (e.g., “R1C2”). Apply to cell. |
|
|
row[,] col |
Row number, followed by column letter or number |
|
(e.g., “2,C”, or “2,3”), separated by “,”. Apply to cell. |
|
|
454—Appendix B. Command Reference
row |
Row number (e.g., “2”). Apply to all cells in the row. |
|
|
col |
Column letter (e.g., “B”). Apply to all cells in the col- |
|
umn. |
|
|
first_cell[:]last_cell, |
Top left cell of the selection range (specified in “cell” |
first_cell[,]last_cell |
format), followed by bottom right cell of the selection |
|
range (specified in “cell” format), separated by a “:” or |
|
“,” (e.g., “A2:C10”, “A2,C10”, or “R2C1:R10C3”, |
|
“R2C1,R10C3”). Apply to all cells in the rectangular |
|
region defined by the first cell and last cell. |
first_cell_row[,] first_cell_col[,] last_cell_row[,] last_cell_col
Top left cell of the selection range (specified in “row[,] col” format), followed by bottom right cell of the selection range (specified in “row[,] col” format), separated by a “,” (e.g., “2,A,10,C” or “2,1,10,3”). Apply to all cells in the rectangular region defined by the first cell and last cell.
The color_arg specifies the color to be applied to the text in the cells. The color may be specified using predefined color names, or by specifying the individual red-green-blue (RGB) components using the special “@RGB” function. The latter method is obviously more difficult, but allows you to use custom colors.
The predefined colors are given by the keywords (with their RGB equivalents):
blue |
@rgb(0, 0, 255) |
|
|
red |
@rgb(255, 0, 0) |
|
|
green |
@rgb(0, 128, 0) |
|
|
black |
@rgb(0, 0, 0) |
|
|
white |
@rgb(255, 255, 255) |
|
|
purple |
@rgb(128, 0, 128) |
|
|
orange |
@rgb(255, 128, 0) |
|
|
yellow |
@rgb(255, 255, 0) |
|
|
gray |
@rgb(128, 128, 128) |
|
|
ltgray |
@rgb(192, 192, 192) |
|
|
Examples
To set a purple background color for the cell in the second row and third column of TAB1, you may use any of the following:
tab1.setfillcolor(C2) @rgb(128, 0, 128)
setfont—455
tab1.setfillcolor(2,C) @RGB(128, 0, 128)
tab1.setfillcolor(2,3) purple
tab1.setfillcolor(r2c3) purple
You may also specify a yellow color for the background of an entire column, or an entire row,
tab1.setfillcolor(C) @RGB(255, 255, 0)
tab1.setfillcolor(2) yellow
or for the background of the cells in a rectangular region:
tab1.setfillcolor(R2C3:R3C6) ltgray
tab1.setfillcolor(r2c3,r3c6) ltgray
tab1.setfillcolor(2,C,3,F) @rgb(192, 192, 192)
tab1.setfillcolor(2,3,3,6) @rgb(192, 192, 192)
Cross-references
For additional discussion of tables see Chapter 4, “Working with Tables”, on page 47.
See settextcolor (p. 467)and setfont (p. 455) for details on changing text color and font, and setlines (p. 465) for drawing lines between around and through cells. See setformat (p. 456) for setting cell formats.
setfont |
Table Proc |
|
|
Set the font for text in the specified table cells.
Syntax
Table Proc: |
table_name.setfont(cell_range) font_args |
where cell_range describes the table cells to be modified, and font_args is a set of arguments used to modify the existing font settings. See setfillcolor (p. 453) for the syntax for cell_range.
The font_args may include one or more of the following:
face_name |
A string that specifies the typeface name of the font, |
|
enclosed in double quotes. |
|
|
integer[pt] |
Integer font size, in points, followed by the “pt” identi- |
|
fier (e.g., “12pt”). |
|
|
+b / -b |
[Add / remove] boldface. |
456—Appendix B. Command Reference
+i / -i |
[Add / remove] italics. |
+s / -s |
[Add / remove] strikethrough. |
|
|
+u / -u |
[Add / remove] underscore. |
|
|
Examples
tab1.setfont(B3:D10) "Times New Roman" +i
sets the font to Times New Roman Italic for the cells defined by the rectangle from B3 (row 3, column 2) to D10 (row 10, column 4).
tab1.setfont(3,B,10,D) 8pt
changes all of text in the region to 8 point.
tab1.setfont(4,B) +b -i
removes the italic, and adds boldface to the B4 cell (row 4, column 2).
The commands:
tab1.setfont(b) -s +u 14pt
tab1.setfont(2) "Batang" 14pt +u
modify the fonts for the column B, and row 2, respectively. The first command changes the point size to 14, removes strikethrough and adds underscoring. The second changes the typeface to Batang, and adds underscoring,
Cross-references
For additional discussion of tables see Chapter 4, “Working with Tables”.
See settextcolor (p. 467) and setfillcolor (p. 453) for details on changing the text and cell background colors. See setformat (p. 456) for setting the cell formats.
setformat
Alpha Proc | Coef Proc | Group Proc | Matrix Proc | Series Proc | Rowvector Proc | Sym Proc | Table Proc | Vector Proc
Set the display format for cells in object spreadsheet and table views.
Syntax
Group Proc: |
group_name.setformat(col_range) format_arg |
Table Proc: |
table_name.setformat(cell_range) format_arg |
Object Proc: |
object_name.setformat format_arg |
setformat—457
where format_arg is a set of arguments used to specify format settings. If necessary, you should enclose the format_arg in double quotes.
The cell_range option is used to describe the columns to be updated in groups and the cells to be modified in tables. For all other objects, setformat operates on all of the cells in the object.
For groups, the col_range may take one of the following forms:
@all |
Apply to all series in the group. |
|
|
col |
Column number or letter (e.g., “2”, “B”). Apply to the |
|
series corresponding to the column. |
|
|
first_col[:]last_col |
Colon delimited range of columns (from low to high, |
|
e.g., “3:5”). Apply to all series corresponding to the col- |
|
umn range. |
|
|
For tables, the cell_range may take one of the following forms:
@all |
Apply to all cells in the table. |
|
|
cell |
Cell identifier. You can identify cells using either the col- |
|
umn letter and row number (e.g., “A1”), or by using “R” |
|
followed by the row number followed by “C” and the |
|
column number (e.g., “R1C2”). Apply to cell. |
|
|
row[,] col |
Row number, followed by column letter or number (e.g., |
|
“2,C”, or “2,3”), separated by “,”. Apply to cell. |
|
|
row |
Row number (e.g., “2”). Apply to all cells in the row. |
|
|
col |
Column letter (e.g., “B”). Apply to all cells in the col- |
|
umn. |
|
|
first_cell[:]last_cell, Top left cell of the selection range (specified in “cell” for- first_cell[,]last_cell mat), followed by bottom right cell of the selection range
(specified in “cell” format), separated by a “:” or “,” (e.g., “A2:C10”, “A2,C10”, or “R2C1:R10C3”, “R2C1,R10C3”). Apply to all cells in the rectangular region defined by the first cell and last cell.
first_cell_row[,] first_cell_col[,] last_cell_row[,] last_cell_col
Top left cell of the selection range (specified in “row[,] col” format), followed by bottom right cell of the selection range (specified in “row[,] col” format), separated by a “,” (e.g., “2,A,10,C” or “2,1,10,3”). Apply to all cells in the rectangular region defined by the first cell and last cell.
458—Appendix B. Command Reference
To format numeric values, you should use one of the following format specifications:
g[.precision] |
significant digits |
|
|
f[.precision] |
fixed decimal places |
|
|
c[.precision] |
fixed characters |
|
|
e[.precision] |
scientific/float |
|
|
p[.precision] |
percentage |
|
|
r[.precision] |
fraction |
|
|
In order to set a format that groups digits into thousands, place a “t” after a specified format. For example, to obtain a fixed number of decimal places, with commas used to separate thousands, use “ft[.precision]”. To obtain a fixed number of characters with a period used to separate thousands, use “ct[..precision]”.
If you wish to display negative numbers surrounded by parentheses (i.e., display the number -37.2 as “(37.2)”), then you should enclose the format string in “()” (e.g., “f(.8)”).
To format numeric values using date and time formats, you may use a subset of the possible date format strings (see “Date Formats” on page 132). The possible format arguments, along with an example of the date number 730856.944793113 (January 7, 2002 10:40:30.125 p.m) formatted using the argument are given by:
WF |
(uses current EViews workfile |
|
date display format) |
|
|
YYYY |
“2002” |
|
|
YYYY-Mon |
“2002-Jan” |
|
|
YYYYMon |
“2002 Jan” |
|
|
YYYY[M]MM |
“2002[M]01” |
|
|
YYYY:MM |
“2002:01” |
|
|
YYYY[Q]Q |
“2002[Q]1” |
|
|
YYYY:Q |
“2002:Q |
|
|
YYYY[S]S |
“2002[S]1” (semi-annual) |
|
|
YYYY:S |
“2002:1” |
|
|
YYYY-MM-DD |
“2002-01-07” |
|
|
YYYY Mon dd |
“2002 Jan 7” |
|
|
YYYY Month dd |
“2002 January 7” |
|
|
YYYY-MM-DD HH:MI |
“2002-01-07 22:40” |
|
|
YYYY-MM-DD HH:MI:SS |
“2002-01-07 22:40:30” |
setformat—459
YYYY-MM-DD HH:MI:SS.SSS |
“2002-01-07 22:40:30.125” |
Mon-YYYY |
“Jan-2002” |
|
|
Mon dd YYYY |
“Jan 7 2002” |
|
|
Mon dd, YYYY |
“Jan 7, 2002” |
|
|
Month dd YYYY |
“January 7 2002” |
|
|
Month dd, YYYY |
“January 7, 2002” |
|
|
MM/DD/YYYY |
“01/07/2002” |
|
|
mm/DD/YYYY |
“1/07/2002” |
|
|
mm/DD/YYYY HH:MI |
“1/07/2002 22:40” |
|
|
mm/DD/YYYY HH:MI:SS |
“1/07/2002 22:40:30” |
|
|
mm/DD/YYYY HH:MI:SS.SSS |
“1/07/2002 22:40:30.125” |
|
|
mm/dd/YYYY |
“1/7/2002” |
|
|
mm/dd/YYYY HH:MI |
“1/7/2002 22:40” |
|
|
mm/dd/YYYY HH:MI:SS |
“1/7/2002 22:40:30” |
|
|
mm/dd/YYYY HH:MI:SS.SSS |
“1/7/2002 22:40:30.125” |
|
|
dd/MM/YYYY |
“7/01/2002” |
|
|
dd/mm/YYYY |
“7/1/2002” |
|
|
DD/MM/YYYY |
“07/01/2002” |
|
|
dd Mon YYYY |
“7 Jan 2002” |
|
|
dd Mon, YYYY |
“7 Jan, 2002” |
|
|
dd Month YYYY |
“7 January 2002” |
|
|
dd Month, YYYY |
“7 January, 2002” |
|
|
dd/MM/YYYY HH:MI |
“7/01/2002 22:40” |
|
|
dd/MM/YYYY HH:MI:SS |
“7/01/2002 22:40:30” |
|
|
dd/MM/YYYY HH:MI:SS.SSS |
“7/01/2002 22:40:30.125” |
|
|
dd/mm/YYYY hh:MI |
“7/1/2002 22:40” |
|
|
dd/mm/YYYY hh:MI:SS |
“7/1/2002 22:40:30” |
|
|
dd/mm/YYYY hh:MI:SS.SSS |
“7/1/2002 22:40:30.125” |
|
|
hm:MI am |
“10:40 pm“ |
|
|
hm:MI:SS am |
“10:40:30 pm” |
|
|
hm:MI:SS.SSS am |
“10:40:30.125 pm” |
|
|
HH:MI |
“22:40” |
|
|
HH:MI:SS |
“22:40:30” |
|
|
HH:MI:SS.SSS |
“22:40:30.125” |
460—Appendix B. Command Reference
hh:MI |
“22:40” |
hh:MI:SS |
“22:40:30” |
|
|
hh:MI:SS.SSS |
“22:40:30.125” |
|
|
Note that the “hh” formats display 24-hour time without leading zeros. In our examples above, there is no difference between the “HH” and “hh” formats for 10 p.m.
Also note that all of the “YYYY” formats above may be displayed using two-digit year “YY” format.
Examples
To set the format for a series or a matrix object to fixed 5-digit precision, simply provide the format specification:
ser1.setformat f.5
matrix1.setformat f.5
For groups, provide the column identifier and format. The commands:
group1.setformat(2) f(.7)
group1.setformat(c) e.5
set the formats for the second and third series in the group.
You may use any of the date formats given above:
ser2.setformat YYYYMon
group1(d).setformat "YYYY-MM-DD HH:MI:SS.SSS"
to set the series display characteristics.
For tables, you must provide a valid cell specification:
tab1.setformat(B2) hh:MI:SS.SSS
tab1.setformat(2,B,10,D) g(.3)
tab1.setformat(R2C2:R4C4) "dd/MM/YY HH:MI:SS.SSS"
Cross-references
For additional discussion of tables see Chapter 4, “Working with Tables”.
See also setfont (p. 455), settextcolor (p. 467) and setfillcolor (p. 453) for details on changing the text font and text and cell background colors.
