ckassab
4th December 2004, 23:32
I do not have the source for tiitm0521m000
Could somebody provide an example of use for dll tiitmdll0003 to convert a quantity between units?
Thank you in advance
Carlos Kassab
toolswizard
6th December 2004, 15:56
I thought that having the function usage may help you.
function extern domain tcconv tiitm.dll0003.conv.factor(
domain tccprj i.cprj,
domain tcitem i.item,
domain tccitg i.citg,
domain tccuni i.basu,
domain tccuni i.unit,
...)
|
| Purpose: For a given (customized) item the conversion factor is returned.
| On three levels the conversion can be present. This routine
| will search as follows:
| 1 item level
| 2 itemgroup level
| 3 general level
| Input : - project (mandatory if it concerns a customized item)
| - itemcode, (mandatory if you want to search on item level)
| - itemgroup (not mandatory but it will speed up things)
| - base unit (not mandatory but it will speed up things,
| mandatory if you don't fill in itemcode)
| - Unit (mandatory)
| If you don't specify itemgroup or base unit this routine will
| read these fields from the item table or unit/parameter table.
| - Other available arguments:
| Number of args | Meaning
| ---------------+-------------------------------------------
| 5 | arg. 6 will be assumed to be true.
| 6 | When no conv. factor has been found and this
| | flag = true; '0' will be returned else '1'
| 12 | arg. 6 - 12 : all record fields (tiitm004) are
| | returned; in sequence : cprj, item,
| | citg, basu, cuni, conv.factor, rpow.
| 13 | arg. 6 -12 are the same as above.
| | arg. 13 has the same meaning as argument '6'
| Output : 0 if no factor is found else the conv. has been found.
|
function extern tiitm.dll0003.read.mcs001.tccu(
domain tccuni i.basu,
domain tccuni i.unit,
ref domain tctccu o.basu.tccu,
ref domain tctccu o.unit.tccu) |EV#10221856
|
| Purpose: For the two units (base unit and other unit) the physical
| quantity is read
| Input : - base unit
| - other unit
| Output : - physical quantity of base unit
| - physical quantity of other unit
|
function extern tiitm.dll0003.det.base.unit(
domain tctccu i.tccu,
ref domain tccuni o.base.unit)
|
| Purpose: For a given physical quantity the base unit is read in MCS parameters
| Input : physical quantity
| Output : base unit
|
function extern tiitm.dll0003.read.parm.mcs000() |EV#10221856
|
| Purpose: The MCS parameters are read
| Input : void
| Output : void
|
function extern domain tcbool tiitm.dll0003.unit.in.unitset(
domain tcuset i.uset,
domain tccuni i.cuni,
domain tcmcs.str4 i.type,
long i.updt,
domain tcbool i.mess) |EV#10221856
|
| Purpose: For a given unitset this routine checks if the given unit is
| present. If not present or this unit is not allowed an error is
| return. The user can specify that a message must be given or not.
| Input : - unitset (mandatory)
| - unit (mandatory)
| - type (mandatory: "trad", "prod", "pric", "stor", "cont" or
| "inve"; if empty no check on the type is done)
| - updt the unit is being used during 'ADD.SET' or
| 'MODIFY.SET'. The variable 'update.status' can be used
| - message (mandatory, true: a message will be given,
| false: no message is given (in case of
| an error))
| Output : 'False' if the unit wasn't found or not allowed else 'true'
|
function extern domain tcbool tiitm.dll0003.read.and.check.buom(
domain tccuni i.buom,
ref domain tcconv ref.conv) |EV#10221856
|
| Purpose: For the 'BOM Unit of Measure' the physical quantity is checked and
| the conversion factor from base unit to this unit is read. If no
| unit is found or no conversion factor is found a message is given.
| Input : BOM Unit of Measure
| Output : - converion factor
| - true (a conv. factor was found), false (no unit was found or
| or no conv. factor was found)
|
function extern domain tcconv tiitm.dll0003.read.conv.with.physical.quantity(
domain tccuni i.unit,
domain tctccu i.tccu,
...)
|
| Purpose: For a unit and its physical quantity the conversion factor is read.
| The conv. factor can be found via the base unit (found in MCS parm).
| Input : - unit
| : - physical quantity
| - Other available arguments:
| Number of args | Meaning
| ---------------+-------------------------------------------
| 2 | arg. 3 will be assumed to be true.
| 3 | When no conv. factor has been found and this
| | flag = true; '0' will be returned else '1'
|
| Output : conversion factor
function extern tiitm.dll0003.add.conv.factor( |EV#10022676
domain tccprj i.cprj,
domain tcitem i.item,
domain tccitg i.citg,
domain tccuni i.basu,
domain tccuni i.unit)
|
| Purpose: A conversion factor (value '1') is inserted for certain keyfields.
| Input : - project code
| : - item code
| : - item group
| : - base unit
| : - unit
| Output : void
|
function extern tiitm.dll0003.copy.item.conv.factors( |EV#10022676
domain tccprj cprj.src,
domain tcitem item.src,
domain tccprj cprj.dest,
domain tcitem item.dest) |#10777-1.n
| domain tcitem item.dest, |#10777-1.o
| domain tcbool i.retry) |#10777-1.o
|
| Purpose: To copy all conversion factors from one standard or customized item
| to another item. The user can choose for 'retry' or not.
| Input : - project code from
| : - item code from
| : - project code to
| : - item code to
| : - insert with retry or not
| Output : void
|
function extern tiitm.dll0003.delete.item.conv.factors( |EV#10022676
domain tccprj i.cprj,
domain tcitem i.item) |#10777-1.n
| domain tcitem i.item, |#10777-1.so
| domain tcbool i.retry) |#10777-1.eo
|
| Purpose: To delete all conversion factors from a standard or customized item.
| The user can choose for 'retry' or not.
| Input : - project code
| : - item code
| : - delete with retry or not
| Output : void
|
function extern tiitm.dll0003.convert.to.rpow(
ref domain tcconv conv.o,
ref domain tirpow rpow.o)
|
|
| This function will convert the combination "Conversion Factor / Power" to
| more readable values.
|
| E.g. : - 0.00000001 * 10^6 will be converted to 1.0 * 10^-2
| - 10000000 * 10^0 will be converted to 1.0 * 10^7
|
| Values between 100000 and 0.0001 will not be converted.
|
ckassab
7th December 2004, 01:52
Thank you very much or your help