Jump to content

Bug or User Error


Recommended Posts

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.

Link to comment
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

Link to comment
Share on other sites

  • Developers

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 ?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Moderators

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

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...