2

Has there ever been an implementation of the field function (page 311) in the various flavors of Pick/UniBasic etc. that would operate on a delimiter of more than one character?

The documented implementations I can find stipulate one character as the delimiter argument and if the delimiter is presented with more than one character, the first character of the delimiter string is used instead of the entire string as a delimiter.

I am asking this because there are many instances in the commercial and custom software I maintain where I see attempts to use a multi-character delimiter with the field statement. It seems programmers were using it expecting a different result than is currently happening.

spencer741
  • 965
  • 1
  • 10
  • 22

1 Answers1

1

jBASE does allow for this. From the FIELD docs:

This function returns a multi-character delimited field from within a string. It takes the general form:

FIELD(string, delimiter, occurrence{, extractCount})

where:

string specifies the string, from which the field(s) is to be extracted.
delimiter specifies the character or characters that delimit the fields within the dynamic array.
occurrence should evaluate to an integer of value 1 or higher. It specifies the delimiter used as the starting point for the extraction.
extractCount is an integer that specifies the number of fields to extract. If omitted, assumes one.

Additionally, an example from the docs:

in_Value = "AAAA : BBjBASEBB : CCCCC"
CRT FIELD(in_Value , "jBASE", 1)

Producing output:

AAAA : BB

Update 2020-08-13 (adding context for OpenQM):

As an official comment since we maintain both jBASE and OpenQM, I felt it worth calling out that OpenQM does not allow multi-character delimiters for FIELD().

Mike Wright
  • 502
  • 4
  • 13
  • Thank you. Now I am interested in finding out whether jBASE was derived from a legacy version of the platform which may have allowed this functionality. I read a few things but no mention yet of its direct ancestor. In other words, was this particular capability with the delimiter in this function born with jBASE or did it pre-exist in some fore-running flavor...? – spencer741 Jul 03 '20 at 18:27
  • 2
    I'm sure people will be eager to discuss questions like this in https://groups.google.com/forum/mvdbms. There are many old timers there, including Zumasys and maintainers of the jBase code who may look into the code to see if any comments in there will help. To my understanding jBase is a "clean room" implementation of MV, but was greatly inspired by Microdata REALITY. See the Pick MultiValue Family Tree poster at https://www.pickmultivalue.com/ where jBase is shown as related to the Reality branch and not others. HTH – TonyG Jul 06 '20 at 14:40
  • [TonyG](https://stackoverflow.com/users/190955/tonyg) has this right on multiple levels. Adding some context on the history with jBASE, it appears the support for this goes back to jBASE 3.x. Of the various emulation modes jBASE supports, this behavior is only enabled in `jBASE` and `Prime` mode. The latter is curious as we're not seeing evidence to suggest that Prime ever supported it, but some of the aforementioned community members may have better context here. – Mike Wright Aug 13 '20 at 21:28