Skip to content

replace_objReplaceObjReplaceObjreplace_objreplace_obj🔗

Short description🔗

replace_objReplaceObjReplaceObjreplace_objreplace_obj — Replaces one or more elements of an iconic object tuple.

Signature🔗

replace_obj( object Objects, object ObjectsReplace, out object Replaced, number Index )void ReplaceObj( const HObject& Objects, const HObject& ObjectsReplace, HObject* Replaced, const HTuple& Index )static void HOperatorSet.ReplaceObj( HObject objects, HObject objectsReplace, out HObject replaced, HTuple index )def replace_obj( objects: HObject, objects_replace: HObject, index: MaybeSequence[int] ) -> HObject

Herror replace_obj( const Hobject Objects, const Hobject ObjectsReplace, Hobject* Replaced, const Hlong Index )

Herror T_replace_obj( const Hobject Objects, const Hobject ObjectsReplace, Hobject* Replaced, const Htuple Index )

HObject HObject::ReplaceObj( const HObject& ObjectsReplace, const HTuple& Index ) const

HObject HObject::ReplaceObj( const HObject& ObjectsReplace, Hlong Index ) const

HImage HImage::ReplaceObj( const HImage& ObjectsReplace, const HTuple& Index ) const

HImage HImage::ReplaceObj( const HImage& ObjectsReplace, Hlong Index ) const

HRegion HRegion::ReplaceObj( const HRegion& ObjectsReplace, const HTuple& Index ) const

HRegion HRegion::ReplaceObj( const HRegion& ObjectsReplace, Hlong Index ) const

HXLD HXLD::ReplaceObj( const HXLD& ObjectsReplace, const HTuple& Index ) const

HXLD HXLD::ReplaceObj( const HXLD& ObjectsReplace, Hlong Index ) const

HXLDCont HXLDCont::ReplaceObj( const HXLDCont& ObjectsReplace, const HTuple& Index ) const

HXLDCont HXLDCont::ReplaceObj( const HXLDCont& ObjectsReplace, Hlong Index ) const

HXLDPoly HXLDPoly::ReplaceObj( const HXLDPoly& ObjectsReplace, const HTuple& Index ) const

HXLDPoly HXLDPoly::ReplaceObj( const HXLDPoly& ObjectsReplace, Hlong Index ) const

HXLDPara HXLDPara::ReplaceObj( const HXLDPara& ObjectsReplace, const HTuple& Index ) const

HXLDPara HXLDPara::ReplaceObj( const HXLDPara& ObjectsReplace, Hlong Index ) const

HXLDModPara HXLDModPara::ReplaceObj( const HXLDModPara& ObjectsReplace, const HTuple& Index ) const

HXLDModPara HXLDModPara::ReplaceObj( const HXLDModPara& ObjectsReplace, Hlong Index ) const

HXLDExtPara HXLDExtPara::ReplaceObj( const HXLDExtPara& ObjectsReplace, const HTuple& Index ) const

HXLDExtPara HXLDExtPara::ReplaceObj( const HXLDExtPara& ObjectsReplace, Hlong Index ) const

HObject HObject.ReplaceObj( HObject objectsReplace, HTuple index )

HObject HObject.ReplaceObj( HObject objectsReplace, int index )

HImage HImage.ReplaceObj( HImage objectsReplace, HTuple index )

HImage HImage.ReplaceObj( HImage objectsReplace, int index )

HRegion HRegion.ReplaceObj( HRegion objectsReplace, HTuple index )

HRegion HRegion.ReplaceObj( HRegion objectsReplace, int index )

HXLD HXLD.ReplaceObj( HXLD objectsReplace, HTuple index )

HXLD HXLD.ReplaceObj( HXLD objectsReplace, int index )

HXLDCont HXLDCont.ReplaceObj( HXLDCont objectsReplace, HTuple index )

HXLDCont HXLDCont.ReplaceObj( HXLDCont objectsReplace, int index )

HXLDPoly HXLDPoly.ReplaceObj( HXLDPoly objectsReplace, HTuple index )

HXLDPoly HXLDPoly.ReplaceObj( HXLDPoly objectsReplace, int index )

HXLDPara HXLDPara.ReplaceObj( HXLDPara objectsReplace, HTuple index )

HXLDPara HXLDPara.ReplaceObj( HXLDPara objectsReplace, int index )

HXLDModPara HXLDModPara.ReplaceObj( HXLDModPara objectsReplace, HTuple index )

HXLDModPara HXLDModPara.ReplaceObj( HXLDModPara objectsReplace, int index )

HXLDExtPara HXLDExtPara.ReplaceObj( HXLDExtPara objectsReplace, HTuple index )

HXLDExtPara HXLDExtPara.ReplaceObj( HXLDExtPara objectsReplace, int index )

Description🔗

replace_objReplaceObj replaces one or more elements of the iconic input tuple Objectsobjectsobjects and returns them with Replacedreplacedreplaced. At this, Indexindexindex determines the indices of the elements and ObjectsReplaceobjectsReplaceobjects_replace the corresponding objects to replace. The parameter Indexindexindex must contain one or more integer values (any floating point number must represent an integer value without fraction). Indices of iconic object elements start at 1. If ObjectsReplaceobjectsReplaceobjects_replace contains only one value, this value will be replaced at all indices of Indexindexindex. If a value of Indexindexindex is greater than the length of the iconic input object tuple Objectsobjectsobjects, Replacedreplacedreplaced will be extended accordingly and initialized with empty regions.

Exception: Empty input object🔗

If either Indexindexindex or ObjectsReplaceobjectsReplaceobjects_replace is empty and the other is not, an exception is raised. If both are empty, the output object tuple Replacedreplacedreplaced corresponds to the input Objectsobjectsobjects. If both are not empty, but the input Objectsobjectsobjects is, the empty object will be extended as described above.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

Parameters🔗

Objectsobjectsobjects (input_object) object(-array) → objectHObjectHObjectHObjectHobject

Iconic Input Object.

ObjectsReplaceobjectsReplaceobjects_replace (input_object) object(-array) → objectHObjectHObjectHObjectHobject

Element(s) to replace.

Replacedreplacedreplaced (output_object) object(-array) → objectHObjectHObjectHObjectHobject *

Tuple with replaced elements.

Indexindexindex (input_control) number(-array) → (integer)HTuple (Hlong)HTuple (int / long)MaybeSequence[int]Htuple (Hlong)

Index/Indices of elements to be replaced.

Example🔗

(HDevelop)

gen_empty_obj (Images)
for Index := 1 to 10 by 1
  gen_image_const (Image, 'byte', Index, Index)
  concat_obj (Images, Image, Images)
endfor
gen_empty_obj (Replace)

replace_obj (Images, Replace, Images, 1)

Combinations with other operators🔗

Combinations

Alternatives

select_objSelectObj

See also

count_objCountObj, select_objSelectObj, copy_objCopyObj, insert_objInsertObj

Module🔗

Foundation