Search the GP Tables
Search by TABLE NAME
Search by FIELD NAME
These are our SOP scripts. All of our scripts for Dynamics GP can be found here
DynDeveloper.com

DynDeveloper.com

Table Edits Forum Articles
Table Edits 0 Table Edits 0 Table Edits 0
Sign Up Now!Log In
SteveGray 3/16/2017 11:27:47 AM

Left

Before you can say it, I'll say it for you. I'm old.

<smiles>

I lament the loss of the LEFT function in VB. SUBSTRING is not the same, because it errors if you specify a length longer then the string.

Oh, I know you can code around that with LENGTH. And, I know that LEFT is still available, but you have to fully reference Microsoft.VisualBasic.Left() in order to use it.

That that makes me old, cranky, and lazy. <huge smile>

My answer is this: I include the code below in all my projects as part of the library that I import. It's my helper class for strings.

This class makes LEFT available for string objects, use it like this:

Dim str As String = "12345"
Debug.WriteLine(str.Left(33))
Debug.WriteLine(str.Left(3))

and you'll get these results:

12345
123

If you're not familiar with extension classes, they work on the object type specified in the first parameter. So, in our code below, the first parameter ('theString') is a STRING type so this object extends the STRING class, and only uses one parameter (LENGTH)

 

 

4Penny.net
Version: All
Section: .NET Development






Table Definition Quick Links
All Tables
SOP Tables
RM Tables
GL Tables
POP Tables
HR Tables
PM Tables
UPR Tables
IV Tables
Olympic Tables