fpt and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Reference Manual Home |

CHANGE CHARACTER PARAMETERS TO ...

Syntax:

[DO NOT] CHANGE CHARACTER PARAMETERS TO CHAR
[DO NOT] CHANGE CHARACTER PARAMETERS TO HEX

Function:

Printing CHARACTER*1 parameter values are usually declared as quoted strings. A problem arises with non-printing characters. Some compilers accept the intrinsic function CHAR to define the values, others require HEX constants. This command systematically converts between the two formats.

Where to Use this Command

Operating system command line Yes
Configuration file, config.fsp Yes
Specification (fsp) files, *.fsp Yes
Interactively, to FPT> prompt Yes
Interactive command files Yes
Embedded in the Fortran code Yes

Default:

No change is made by default (Note that defaults may be modified in the configuration file).

Examples

The parameter declarations shown below

CHARACTER*1 c_null,c_one PARAMETER (c_null = CHAR(0)) PARAMETER (c_one = '1'X)

are changed by the command:

% change character parameters to hex

to:

CHARACTER*1 c_null,c_one PARAMETER (c_null='00'X) PARAMETER (c_one='01'X)

and by the command:

% change character parameters to hex

to:

CHARACTER*1 c_null,c_one PARAMETER (c_null=CHAR(0)) PARAMETER (c_one=CHAR('01'X))

Copyright ©1995 to 2016 Software Validation Ltd. All rights reserved.