[AccessD] Treat string as array

William Hindman wdhindman at dejpolsystems.com
Sun Mar 23 00:56:28 CDT 2008


...ah so ...I missed the spaces in your "C o l b y  C o n s u l t i n g" 
example :(

...so how about:

Dim strColby as String
Dim ByteArray() As Byte

strColby = "Colby Consulting"
ByteArray() = strColby

William

----- Original Message ----- 
From: "jwcolby" <jwcolby at colbyconsulting.com>
To: "'Access Developers discussion and problem solving'" 
<accessd at databaseadvisors.com>
Sent: Saturday, March 22, 2008 10:00 PM
Subject: Re: [AccessD] Treat string as array


> Split only works when the string contains "words" or delimited strings. 
> It
> does nothing if it is all one big string of characters.
>
>
> 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 William Hindman
> Sent: Saturday, March 22, 2008 8:47 PM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Treat string as array
>
> ...Split(<string>)
> ...works in 2k+
> ...hth
>
> William
>
> ----- Original Message -----
> From: "jwcolby" <jwcolby at colbyconsulting.com>
> To: "'Access Developers discussion and problem solving'"
> <accessd at databaseadvisors.com>
> Sent: Saturday, March 22, 2008 6:30 PM
> Subject: Re: [AccessD] Treat string as array
>
>
>>A for next iterator.
>>
>> Dim varChar as variant
>> For each varChar in arrSomeStr
>> Do something with varChar
>> Next varChar
>>
>> Much cleaner than
>>
>> Dim IntPtr
>> Dim varChar as variant
>> for intPtr <=len(strSomeStr)
>> varChar = mid(strsomestr,intprt,1)
>> So something with VarChar
>> next intprt
>>
>> They both work but...
>>
>> Strings are just pointers to an memory location on the heap.  Turning a
>> string into an array of characters SHOULD be a function call, optimized 
>> in
>> assembler to be blindingly fast.
>>
>> 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 Rocky Smolin 
>> at
>> Beach Access Software
>> Sent: Saturday, March 22, 2008 6:15 PM
>> To: 'Access Developers discussion and problem solving'
>> Subject: Re: [AccessD] Treat string as array
>>
>>
>> What do you need that you don't get from MID?
>>
>> Rocky
>>
>>>
>>> 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
>>
>> No virus found in this incoming message.
>> Checked by AVG.
>> Version: 7.5.519 / Virus Database: 269.21.8/1338 - Release Date: 
>> 3/21/2008
>> 5:52 PM
>>
>>
>> --
>> AccessD mailing list
>> AccessD at databaseadvisors.com
>> http://databaseadvisors.com/mailman/listinfo/accessd
>> Website: http://www.databaseadvisors.com
>>
>> -- 
>> AccessD mailing list
>> AccessD at databaseadvisors.com
>> http://databaseadvisors.com/mailman/listinfo/accessd
>> Website: http://www.databaseadvisors.com
>>
>
>
>
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.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