Sign in to follow this  
Followers 0
robinsiebler

Bug or User Error

4 posts in this topic

I have a string that is 28 chars long: Extract to "C:\Obj00074.txt". If I specify

$saveFile = StringMid($buttonText, 13, (StringLen($buttonText) - 2))
the text that is returned is C:\Obj00074.txt". However, if I use '15' for the 3rd paratemeter, I get

C:\Obj00074.txt. (StringLen($buttonText)- 2) should equal 15.

Share this post


Link to post
Share on other sites



HI,

you have to post your script, otherwise it will be hard to test it.

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

I have a string that is 28 chars long: Extract to "C:\Obj00074.txt". If I specify

(StringLen($buttonText)- 2) should equal 15.

My vote goes to 28-2=26

Why do you say it should be 15 ?


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

The example your giving doesn't make any sense really.

1. Your starting from the 13th Char.

2. Your using the "Entire StringLen - 2", but you already moved forward 13?

So your output would always be the rest of the string from the 13 char.

Where you trying to do this?

$String = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz'
MsgBox(0, 'info', StringMid($String, 13, (StringLen($String) - 13) - 2))
Note how the example leaves off the "yz" in the string return. Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0