A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Letter and numeral separation



 
 
Thread Tools Display Modes
  #11  
Old April 27th, 2005, 12:33 AM
Sandy Mann
external usenet poster
 
Posts: n/a
Default

Harlan,

Dim i As Long, k As Long, c As String * 1


May I ask why you DIMmed c as String *1?

I always understood that doing maths on strings was meaningless as in
"Sandy" * 1

Regards

Sandy

--
to e-mail direct replace @mailinator.com with @tiscali.co.uk



  #12  
Old April 27th, 2005, 01:33 PM
Bob Phillips
external usenet poster
 
Posts: n/a
Default

It is not doing math on it, but declaring it as a one byte string.

Try setting it to say 2 bytes in code and see what it contains after,

c = "AB"

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Sandy Mann" wrote in message
...
Harlan,

Dim i As Long, k As Long, c As String * 1


May I ask why you DIMmed c as String *1?

I always understood that doing maths on strings was meaningless as in
"Sandy" * 1

Regards

Sandy

--
to e-mail direct replace @mailinator.com with @tiscali.co.uk





  #13  
Old April 27th, 2005, 01:38 PM
Dave Peterson
external usenet poster
 
Posts: n/a
Default

I'm not Harlan, but take a look at Dim in VBA's help.

Then look at the description for "type". It contains this line "...String *
length (for fixed-length strings)..."

Then try something like:

Dim myString As String * 1
myString = "asdfasdf"
MsgBox myString



Sandy Mann wrote:

Harlan,

Dim i As Long, k As Long, c As String * 1


May I ask why you DIMmed c as String *1?

I always understood that doing maths on strings was meaningless as in
"Sandy" * 1

Regards

Sandy

--
to e-mail direct replace @mailinator.com with @tiscali.co.uk


--

Dave Peterson
  #14  
Old April 27th, 2005, 08:55 PM
Sandy Mann
external usenet poster
 
Posts: n/a
Default

Thank you Dave & Bob,

I did actually look in VBA Help but in my naivety I look up STRING, it
never occurred to me to look up DIM (no puns please g)

Regards,

Sandy

--
to e-mail direct replace @mailinator.com with @tiscali.co.uk


"Dave Peterson" wrote in message
...
I'm not Harlan, but take a look at Dim in VBA's help.

Then look at the description for "type". It contains this line "...String

*
length (for fixed-length strings)..."

Then try something like:

Dim myString As String * 1
myString = "asdfasdf"
MsgBox myString



Sandy Mann wrote:

Harlan,

Dim i As Long, k As Long, c As String * 1


May I ask why you DIMmed c as String *1?

I always understood that doing maths on strings was meaningless as in
"Sandy" * 1

Regards

Sandy

--
to e-mail direct replace @mailinator.com with @tiscali.co.uk


--

Dave Peterson




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:03 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.