MMpy.FileStruct.set_field_type

Syntax

structure.set_field_type(field_id, field_type)

Description

Sets the type of the selected field.

Parameters

Name
Type
Description

field_id 

int ID of the field.
field_type MMpy.FieldType Type of the field.

See Also

MMpy.FieldType

MMpy.FileStruct.get_field_type()

Notes

Be careful when using this function, as it can result in data loss. The user must ensure that the data is copied somewhere else beforehand, or that the old and new data types are compatible.

Valid choices for field_type are:

  • MMpy.FieldType.character
  • MMpy.FieldType.numeric
  • MMpy.FieldType.real
  • MMpy.FieldType.float
  • MMpy.FieldType.long
  • MMpy.FieldType.short
  • MMpy.FieldType.unknown

Examples

file = MMpy.File()
file.open(...)
  
structure = file.structure
struct.set_field_type(0, MMpy.FieldType.real)
  
file.structure = struct
file.close()

Resource ID

IDPH_FILESTRUCT_SETFLDTYPE