[AccessD] Treat string as array

jwcolby jwcolby at colbyconsulting.com
Sat Mar 22 16:57:34 CDT 2008


Well yea.  Uhh... sure.   

I thought I was asking a syntax question.

Given strCompanyName Colby Consulting

I need an array of:

C o l b y  C o n s u l t i n g

It is exactly that piece that I do not know how to do elegantly.  Oh sure I
can do the Mid() function N times but that is inelegant.  I thought perhaps
there would be a single SomeKeyWord(strCompanyName) that would return an
array of the characters in the strCompanyName.  I really don't work with
arrays that much and so I am much less godly in that area.

John W. Colby
Colby Consulting
www.ColbyConsulting.com 
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller
Sent: Saturday, March 22, 2008 5:41 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Treat string as array

Forgive me, el maestro de los classes, but I would have thought this a
no-brainer for you. Write a class with some methods that walk the string
accordingly, like Next and Previous (should you need that one) and so on.
Encapsulate the mechanics of SubStr() and you're there. No?

And here I deemed you a godlike being regarding classes! Turns out you bleed
just like the rest of us. Go figure. I can already see this class, thanks to
your teachings, and those also of Shamil. Init walks the string, the other
guys deal with the resultant array. Granted, Split() looks for a delimiter,
which in this case we do not have, but we can walk the string instead, no?
After that, it's cheesecake.

A.

On 3/22/08, jwcolby <jwcolby at colbyconsulting.com> wrote:
>
> How can I turn a string into an array?  I need to iterate through the 
> characters of a string.
>
> For each char in str
>         dosomething char
> Next char
>
> John W. Colby
> Colby Consulting
> www.ColbyConsulting.com
>
>
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list