"(%1.%2 like %3.%4)",
filteredDs.name(),
fieldStr(FilteredTable, Field1),
definitionDs.name(),
fieldStr(FilterDefiniton, Field1)));
}
if (!set.empty())
{}
*--*
static Set dimensionCodesSet2DimensionTopicsSet(Set _dimensionCodesSet) { Set topicsSet; SetEnumerator setEnumerator; DimensionTopic dimensionTopic; ; topicsSet = new Set(Types::Class); setEnumerator = _dimensionCodesSet.getEnumerator(); while (setEnumerator.moveNext()) { dimensionTopic = DimensionTopic::construct( DimensionTopicType::Dimension, Dimensions::code2ArrayIdx(setEnumerator.current())); topicsSet.add(dimensionTopic); } return topicsSet; }
static void TDS_SetExample(Args _args)
{
Set s1 = new Set(Types::String);
SetIterator si;
Set s2 = new Set(Types::String);
Set resultSet;
// set will always result in ascending order and it will not allow duplicates
// set can perform additional operations - union , intersection and difference
s1.add("A");
S1.add("z");
s1.add("B");
s1.add("F");
s1.add("F");
// To find any value in a set use "in" method
if (s1.in("b") == true)
{
info ("b exists");
}
else
{
error ("b doesnt exists");
}
s2.add("A");
s2.add("k");
S2.add("g");
info(int2str(s1.elements()));
si = new SetIterator(s1);
while (si.more())
{
info(si.value());
si.next();
}
resultSet = Set::intersection(s1, s2);
si = null;
info ("Intersection");
si = new SetIterator(resultSet);
while (si.more())
{
info(si.value());
si.next();
}
}
- Map can hold a key and associated value
- Imp methods : elements, Key, insert
static void TDS_MapExample(Args _args)
{
// Maps are used to hold the key and correspondiong value
Map m = new Map(Types::Integer, Types::String);
MapIterator mi;
;
m.insert(100, "Nick");
m.insert(200, "Leo");
m.insert(400, "Eve");
mi = new MapIterator(m);
while (mi.more())
{
info(mi.key());
info(mi.value());
mi.next();
}
}
static void MAP_LoadTableTable(Args _args)
{
Map m = new Map(Types::String, Types::Real);
MEE_CustTable k;
MapIterator mi;
;
while select k
{
m.insert(k.CustomerId, k.Creditlimit);
}
info(int2str(m.elements()));
info ("_______________________");
mi = new MapIterator(m);
while (mi.more())
{
info(mi.key());
info(mi.value());
mi.next();
}
}
- Containers are used to store different datatypes
- Max columns in a container - 50
>> some important functions :
conlen - gives the length of the container
conpeek - gives the value of an element based on the index
conpoke - used for replacing any element with new element value
condel - willl delete the elements in cotnainer based on the start postion and number of elements to be deleted
connull - will empty the container
conins - will help to insert new elements to container
conview - to viuew the elements in the container - onyl for unit testing
confind - to find a particular element exists in container - it will give u the postiion/index
>> Just look at the following example to undestand how these methods can be applied :
static void TDS_Containers(Args _args)
{
Container con = [1000, "Rahul", 5000.00, 56];
container resultCon;
int i;
int position;
// container limit is 50 columns
;
// container index starts with 1
// to get the length of the container
info(int2str(conlen(con)));
// to get any value based on the index use conpeek() function
info(conpeek(con, 3));
// to get all the values in one shot
info("__________________________________");
for ( i = 1; i <= conlen(con); i++)
{
info(conpeek(con,i));
}
info("__________________________");
resultcon = condel(con, 2,2);
conview(resultcon); // this should be only used for testing purpose
// to nullify to empty the container
//con = connull();
//info(int2str(conlen(con)));
//
// To insert any new valuezs into container - use conins()
// To replace any value in the container - use conpoke()
// to find any value in container- use confind
position= confind(con, "sreedhar");
info(strfmt("sreedhar is found at %1 position", position));
}
SELECT ME.Name ,
ME2.Name ,
MED.MODIFIEDDATETIME ,
MED.MODIFIEDBY
FROM dbo.ModelElementData AS MED
LEFT JOIN dbo.ModelElement AS ME ON ME.ElementHandle = MED.ElementHandle
LEFT JOIN dbo.ModelElement AS ME2 ON ME2.ElementHandle = ME.ParentHandle
WHERE MED.MODIFIEDBY like '%CKR%'
ORDER BY MED.MODIFIEDDATETIME DESC
Kaynak: Microsoft
The following table lists the X++ functions that belong in each previous category.
Category | X++ function |
|---|---|
Business |
|
Compiler Verified (also named Intrinsic) |
|
Container |
|
Convert |
|
Date |
|
Enum |
|
Math |
|
Miscellaneous |
|
Reflection |
|
Session |
|
String |
|