0

In X++, strScan is a simple but powerful function: it lets you look inside a string and find out where a certain piece of text appears. If the substring is there, it gives you the position (starting from 1). If it’s not there, it returns 0. You also get to decide where the search begins and how much of the string to check. Think of it like a text “metal detector” you can use when you’re scanning product labels, notes, or descriptions.

For example, in an electronics warehouse system, you might need to see if a note says “FRAGILE.” With strScan, you can quickly check:

// A wave note
str note = "Wave 5512 | carrier UPS | FRAGILE | door A";
if (strScan(note, "FRAGILE", 1, strLen(note)))
{
    info("Add extra packaging step");
}

Here, the system will spot the word “FRAGILE” and trigger special handling.

Another case: suppose a location string is "RACK-03/BIN-12A". You can search for "BIN-" and then slice out the exact bin code. That way, you don’t need a fancy parser—just strScan and subStr will do the trick.


Now, compare this to con2str. Instead of searching inside one string, con2str takes a container (a small bundle of values) and turns it into one string. For instance:

// [salesId, workerId, qty]
container summary = ["SO-000423", "WKR007", "12"];
str line = con2str(summary, "|"); // "SO-000423|WKR007|12"

That’s great for logging, quick exports, or audit notes in your warehouse.

So the difference is simple:

  • strScan → look inside a string to see if it contains something important.
  • con2str → take a bunch of values in a container and squash them into one string for output.

And if you just need one value from a container, you don’t use either of those—you use conPeek. For example:

// [salesId, linesPicked, cartonCount]
container packed = ["SO-000511", 9, 3];
int linesPicked = conPeek(packed, 2); // returns 9

So in short: search with strScan, serialize with con2str, and pluck a single value with conPeek—three tools for three very different everyday warehouse needs.

Have a Question ?

Fill out this short form, one of our Experts will contact you soon.

Talk to an Expert Today

Call Now

Call Now800-453-5961