Tips and Tricks: False Arrays

WhippingBoy

WhippingBoy

VIP Member
Greetings all,

I haven't done one of these in a long while, but I have a new article on my oh-so-abandoned website.

It's on False Arrays and offers a cute trick when you need an array-like feature in your code.

Enjoy:

False Arrays
 
Darren,

I enjoyed!

So simple and has a plethora of uses. Not being that versed in C, I really appreciate the tip, thanks.
 
Darren,

I completely agree that this is a great solution and applaud your ingenuity. However, I've thought of a flaw in the process that we would potentially run into at our company. In the event that a smaller item number (ex: 117) was found in another item number (ex: 4117, 96117, 61173, etc.) then wouldn't your solution return a false positive? I'm sure that your code example could be manipulated in such a way as to get around this, but I'm just having trouble envisioning a solution to this problem. Anyone have a suggestion?
 
I see what you're saying. By also searching for the 'commas' (before and after the item) in the Find In String function that condition shouldn't arise.
 
Hi Darren,

Just an addition for the correction:

You should initialize VA evt_ItemArrayString_DESC2000 with comma, when it is Blank or Null (before concatenating the first item).
Without this, you can not find the first element in the array searching for ",item,".

Regards,

Zoltán
 
Actually Zoltan, that's already being done. Note the line after:

If VA evt_StringIsInString_EV01 is not equal to "1"
 
Back
Top