Simplicty and flexibility!


New Function in 8 - StringFrom() - Search a string from the tail and return it. (Ver 8.0.0.1196)

Started by DataEase
You will need to Sign In to be able to comment on the Blog!

New Function in 8 - StringFrom() - Search a string from the tail and return it. (Ver 8.0.0.1196)

This useful little function is part of a full set including StringTo() and StringBetween().

StringFrom() search the input string from the tail end inwards looking for the search string. When it finds it, it returns the tail of the string up to this point.

There is many useful areas, but we have to be honest that the one we made it primarily for was to strip file names from full paths.

This is an old headache in DataEase and the only way you could do it up to now was by single stepping through the string. Needless to say you would need to do that in DQL or OML, but now you can do it directly in the Form/Table.

The example to the right is a button action that browses My Documents, returns the full file path to the function, use StringFrom() to chunk off the file name and inserts it into the destionation field with SetValue().

If this function was to be run with pre 8.0 functions it would look like this:
""
Empty ;-) This is 100% pure 8.


Written by DataEase 15/01/13 at 15:07:45 Dataease [{8}]FIVE