| View previous topic :: View next topic |
| Author |
Message |
Question Guest
|
Posted: Fri Feb 02, 2007 2:32 am Post subject: SIZEOF command against strings |
|
|
| Is there an equivalent SIZEOF command in ahk to determine size of content strings? |
|
| Back to top |
|
 |
Dave72
Joined: 27 Jan 2007 Posts: 30 Location: Canada
|
Posted: Fri Feb 02, 2007 3:41 am Post subject: |
|
|
| Not sure what SIZEOF is.. but I use StringLen to get the number of chars in a string. |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 2951 Location: Minnesota
|
Posted: Fri Feb 02, 2007 4:07 am Post subject: |
|
|
| Yes, you can use the StringLen command or the StrLen() function. |
|
| Back to top |
|
 |
Question Guest
|
Posted: Fri Feb 02, 2007 4:13 am Post subject: |
|
|
I am sorry, the string, would be an array, so I am attempting to hope to find out how many strings are in the array. Sorry for being confusing  |
|
| Back to top |
|
 |
nick
Joined: 24 Aug 2005 Posts: 549 Location: Berlin / Germany
|
Posted: Fri Feb 02, 2007 6:01 am Post subject: |
|
|
How do you create your array? _________________ nick  |
|
| Back to top |
|
 |
Dippy46
Joined: 06 Jul 2004 Posts: 171 Location: Manchester, England.
|
Posted: Fri Feb 02, 2007 1:17 pm Post subject: |
|
|
@Question,
Sizeof reports the amount of space allocated to a string NOT the amount being used. The equivalent AHK commnd is.
| Code: |
SIZEOF := VarSetCapacity(String)
|
Which of course is not necessarily the same as STRLEN.
Regards
Dave. _________________ Simple ideas lie within reach, only of complex minds |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Fri Feb 02, 2007 2:09 pm Post subject: |
|
|
| Quote: | | so I am attempting to hope to find out how many strings are in the array | AHKs help wrote: | Quote: | | it is safest to use the zero element (MyArray0) to determine how many items were actually produced by the command. |
|
|
| Back to top |
|
 |
|