I can't think of any real imporovements in Access that I'd like to see that
are not on the programming side. Make MSFT Basic as powerful as Pick Basic
in string handling would be one.
I written a lot of code in Pick. And, I will say that I miss a LOT of the
string handling.
However, I think much of pick's strength is that you work with "one" record
in code that represents a complex structure.
As more time goes by, then I do find some equivalents in string handling
that vb has. For example:
strText = "one two three"
In pick, to grab the middle word "two", we can go:
print field(strText," ",2)
I really like the above. However, in VB, (which ms-access uses), you can go:
debug.Print split(strTxt," ")(1)
So, as time progresses, I do find the string handling in VB up to the task.
And, pick basic does miss a few things in terms of string handling
.. For example, how do you grab the last two characters of a string?
print strText[len(strText) - 2,2]
That is a bit worse then:
msgbox right(strText,2)
(pick basic is missing the right$() command!)
Further, pick basic don't allow left side expressions. So, to replace the
first 3 characters with "four", you can go:
mid(strText,1,3) = "four"
In pick basic, you have to go:
strText = "four" : strText[3,999]
And, the above has been simplified, as I used 999, and to be "correct", I
*really* should put a len() function in there.
Or, how about grabbing all charters from the 4th to the end of the string
msgbox mid(strText,4)
In pick basic, you have to go:
print strtext[4,9999]
(again, I just used a arbitrary length for the string..and should not have
to do that)
About the only real function I miss now is dcount, and I wrote my own
function that does the same in VB.
Expose the previous record
Hum, that is going to depend on how you navigate. (but, point accepted)
and the original content of the current record
would be a couple more.
There is the "oldValue" property of a control that does this.
I think that pick is so strong in strings because all records are a
string..but that somewhat clouds the issue that pick basic is really good
with stings. For example, often you need to "pass" a variable number of
values to a subroutine. In Pick, we *often* use a dynamic string.
So, we get:
Pick basic:
strParms = ""
strParms<-1> = "one"
strParms<-2> = "two"
strParms<-3> = "three"
Call MyCoolSub(strParms)
SUBROUTINE MyCoolSub(MyParms)
nump = dcount(strparms,AM)
for i = 1 to nump
print MyParms<i>
next i
The above is great in pick, since we don't have to know how many "values" we
are going to pass.
In VB, you either use a dyanamic array, or better is a colletion
dim colParms as new Colleciton
colParms.Add "one"
colParms.Add "two"
colParms.Add "Three"
Call MyCoolSub(colParms)
Public Sub MyCoolSub(MyParms As Collection)
inum = MyParms.Count
For i = 1 To inum
Debug.Print MyParms(i)
Next i
End Sub
So, over time, I have found a lot of "substitutes" for strings and dynamic
structure that we come to love so much in the pick language.
And really, if you build up a few functions (like dcount), you find that you
miss very little in VB when compared to Pick.
However, what you will always miss is the simplicity, and the fact that a
complex record in pick is a simple string!