dm_js_const Interface

public interface dm_js_const

Generic function that returns JavaScript constant declaration from given name and value as allocatable string.


Module Procedures

private pure function js_const_int32(name, value) result(js)

Returns JavaScript constant declaration of 4-byte integer.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

Constant name.

integer(kind=i4), intent(in) :: value

Constant value.

Return Value character(len=:), allocatable

JavaScript constant.

private pure function js_const_int64(name, value) result(js)

Returns JavaScript constant declaration of 8-byte integer.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

Constant name.

integer(kind=i8), intent(in) :: value

Constant value.

Return Value character(len=:), allocatable

JavaScript constant.

private pure function js_const_real32(name, value) result(js)

Returns JavaScript constant declaration of 4-byte real.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

Constant name.

real(kind=r4), intent(in) :: value

Constant value.

Return Value character(len=:), allocatable

JavaScript constant.

private pure function js_const_real64(name, value) result(js)

Returns JavaScript constant declaration of 8-byte real.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

Constant name.

real(kind=r8), intent(in) :: value

Constant value.

Return Value character(len=:), allocatable

JavaScript constant.

private pure function js_const_string(name, value, quote) result(js)

Returns JavaScript constant declaration of string. The function adds quotation marks to the value by default.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

Constant name.

character(len=*), intent(in) :: value

Constant value.

logical, intent(in), optional :: quote

Add quotation marks.

Return Value character(len=:), allocatable

JavaScript constant.