Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Eviews5 / EViews5 / Docs / EViews 5 Command Ref.pdf
Скачиваний:
91
Добавлен:
23.03.2015
Размер:
5.23 Mб
Скачать

@mid—603

@ltrim(" I doubt that I did it. ")

returns “I doubt that I did it. ”. Note that the spaces on the right remain.

See also @rtrim (p. 606) and @trim (p. 608).

@makedate

Date Function

 

 

Syntax:

@makedate(arg1[, arg2[,arg3]], fmt])

Argument 1:

number, arg1

Argument 2:

number(s) arg2, arg3

Argument 3:

date format, fmt

Return:

date number

Takes the numeric values given by the arguments arg1, and optionally, arg2, etc. and returns a date number using the required format string, fmt.

Example:

The expressions,

@makedate(1999, "yyyy")

@makedate(99, "yy")

both return the date number 729754.0 corresponding to 12 midnight on January 1, 1999.

@makedate(199003, "yyyymm")

@makedate(1990.3, "yyyy.mm")

@makedate(1031990, "ddmmyyyy")

@makedate(30190, "mmddyy")

all return the value 726526.0, representing March 1, 1990.

See “Translating Ordinary Numbers into Date Numbers” on page 141 for additional details.

@mid

String Function

 

 

Syntax:

@mid(str, n1[, n2])

Argument 1:

string, str

Argument 2:

integer, n1

Argument 3:

integer, n2

Return:

string

604—Appendix F. String and Date Function Reference

Returns n2 characters from str, starting at location n1 and continuing to the right. If you omit n2, it will return all of the remaining characters in the string.

Example:

%1 = @mid("I doubt it", 9, 2) %2 = @mid("I doubt it", 9)

See also @left (p. 601) and @right (p. 606).

@neqna

String Function

 

 

Syntax:

@neqna(str1, str2)

Argument 1:

string, str1

Argument 2:

string, str2

Return:

integer

Tests for inequality of str1 and str2, treating null strings as ordinary blank strings, and not as missing values. Strings which test as equal return a 0, and 1 otherwise.

Example:

@neqna("abc", "abc")

returns a 0, while

@eqna("", "def")

returns a 1.

See also @isempty (p. 601) and @eqna (p. 599).

@now

Date Function

 

 

Syntax:

@now

Return:

date number

Returns the date number associated with the current time.

@replace—605

@otod

Date Function | String Function

 

 

Syntax:

@otod(n)

Argument:

integer, n

Return:

string

Observation-TO-Date. Returns a string containing the date or observation corresponding to observation number n, counted from the beginning of the current workfile. For example, consider the string assignment

%1 = @otod(5)

For an annual workfile dated 1991–2000, %1 will contain the string “1995”. For a quarterly workfile dated 1970:1–2000:4, %1 will contain the string “1971:1”. Note that @otod(1) returns the date or observation label for the start of the workfile.

See also @dtoo (p. 599).

@replace

String Function

 

 

Syntax:

@replace(str1, str2, str3[,n])

Argument 1:

string, str1

Argument 2:

string, str2

Argument 3:

string, str3

Argument 4:

integer, n

Return:

string

Returns the base string str1, with the replacement str3 substituted for the target string str2. By default, all occurrences of str2 will be replaced, but you may provide an optional integer n to specify the number of occurrences to be replaced.

Example:

@replace("Do you think that you can do it?", "you", "I")

returns the string “Do I think that I can do it?”, while

@replace("Do you think that you can do it?", "you", "I", 1)

returns “Do I think that you can do it?”.

See also @insert (p. 600) and @mid (p. 603).

606—Appendix F. String and Date Function Reference

@right

String Function

 

 

Syntax:

@right(str, n)

Argument 1:

string, str

Argument 2:

integer, n

Return:

same as source

Returns a string containing n characters from the right end of str. If the source is shorter than n, the entire string is returned. Example:

%1 = @right("I doubt it",8)

returns the string “doubt it”.

See also @left (p. 601), @mid (p. 603).

@rtrim

String Function

 

 

Syntax:

@rtrim(str)

Argument:

string, str

Return:

string

Returns the string str with spaces trimmed from the right.

Example:

@rtrim(" I doubt that I did it. ")

returns the string “ I doubt that I did it.”. Note that the spaces on the left remain.

See also @ltrim (p. 602) and @trim (p. 608).

@str

String Function

 

 

Syntax:

@str(d,[fmt])

Argument 1:

scalar, d

Argument 2:

numeric format string, fmt

Return:

string

Returns a string representing the given number. You may provide an optional format string.

Соседние файлы в папке Docs