Function AttributeCreate2(filename, fieldname: string; fieldindex: integer): integer;
From the specified filename a file called attribute.bin is created, which holds all attributes regarding the links. See definition of attributes here.
The file should be of type DBF (version 3) or DAT file (part of a TAB file).
In the case of a DAT file, the corresponding TAB file needs to be present.
If you supply fieldindex=0, the fieldname will be used. If you supply a fieldindex (1..) it will be used for reading from the file.
If the field, you are pointing at, is a floating point field, it will be rounded.
If any value is negative or >65535, it will be set to 0.
Filename should include a fully qualified path.
Attribute.bin simply holds the values from the input file and so it is possible to write directly to this file if needed. It consists of 16-bit unsigned integers. You may even create the file from scratch yourself, if that suits you better, but you miss being able to encrypt the file.
Use OnAttributeCreateProgress event for tracking progress.
Examples:
AttributeCreate2("roads.dbf","",1)
> Use first field from roads.dbf file.
AttributeCreate2("roads.dat","attrib",0)
> Use field attrib from roads.dat file. File roads.tab needs to be present.
See also AttributeCreate
Alternative method:
If you prefer not to use the road classes, because you already have the exact time or speed on each link in your network, you can use the functions SetLinkSpeed or SetLinkTime instead. For one-way information, you can use the function CloseLink to change one-way status. For entering roundabout status, there is no other way but the attribute file.
Possible error codes: -20 -22 -30 -32 -40
ActiveX / VCL / CLX component: RWnetBase