MMpy.File.get_num_field_value

Syntax

file.get_num_field_value(field_id, record_id)

Description

Returns the numeric representation of the value found at the specified position given.

Parameters

Name
Type
Description

field_id 

int The ID of the target field.

record_id 

int The ID of the target record.

Returns

Type
Description
float The numeric representation of the value found at the specified position. If not found or an incompatible type is found, 0.0 is returned.

See Also

MMpy.File.get_field_id()

MMpy.File.get_str_field_value()

Notes

Record IDs are 1-based, meaning passing an index of 1 will return the first record.

Examples

file_path = MMpy.Project.path() + 'Test.DAT'
 
file = MMpy.File()
file.open(file_path)
 
field = 'EAST'
field_id = file.get_field_id(field)
 
record_id = 1
 
value = file.get_num_field_value(field_id, record_id)
 
print(value)
 
file.close()

Resource ID

IDPH_FILE_GET_NUM_VALUE