Loading...
Searching...
No Matches
arg Module Reference

Inherits arg_base.

Definition

Represents the extended type for method argument .

Examples

use benchmark_argument
use benchmark_kinds
type(arg) :: a
a = arg(12.25_r8, 'arg1')
select type(x => a%value)
type is (real(r8))
!success
class default
stop
end select

Remarks

arg is the extended class of arg, which also contains bound procedures.

Constructors

Initializes a new instance of the arg class

arg(class(*))

type(arg) function arg(class(*) val) 
Parameters
[in]val

Examples

a = arg(5.0d0)

Remarks

arg(class(*), character(*))

type(arg) function arg(class(*) val, character(*) display) 
Parameters
[in]valThe value to be stored in the arg type for later reuse. It can be of any type, inrinsic or not.
[in]displayA charater array that describes the argument. The content of variable is intended to be understood by humans.

Examples

a = arg(5.0d0, 'arg1')

Remarks

arg(class(*), type(string))

type(arg) function arg(class(*) val, type(string) display) 
Parameters
[in]valThe value to be stored in the arg type for later reuse. It can be of any type, inrinsic or not.
[in]displayA string that describes the argument. The content of variable is intended to be understood by humans.

Examples

a = arg(5.0d0, string('arg1'))

Remarks

Definition at line 67 of file Argument.f90.


The documentation for this module was generated from the following file:

Variables

character(:), allocatable display
 String characterizing the argument.
If not specified, the numeric value is stringified.
 
class(*), allocatable value
 Unlimited polymorphic value of the argument.
This property is used to store any value of any type.
 

Methods

◆ assignment()

generic assignment ( class(arg), intent(inout) lhs,
class(*), intent(in) rhs )

Overloading of the assigment procedure.

Parameters
[in,out]lhsclass(arg)
[in]rhsclass(*), unlimited polymorphic

Remarks

The field value is an unlimited polymorphic component It accepts any value of any type.

Examples

The following example uses the assigment(=) the set the value of the argument

type(arg) :: a
a = 5.0_r8

Definition at line 63 of file Argument.f90.

◆ to_string()

procedure, pass, public to_string ( class(arg), intent(in) this)

Returns a string that represents the current object.

Returns
character(:), allocatable

A string that represents the current object.

Examples

character(:), allocatable :: s
type(arg) :: a
a = arg(5.0_r8)
s = a%to_string()

Definition at line 64 of file Argument.f90.