Jump to content
Sign in to follow this  
maxrealqnx

Where am I doing wrong ?

Recommended Posts

maxrealqnx

Hi everyone ;)

I need your help on a problem. Thank you in advance for your help. Best regards :ILA2:

AutoIt v3.3.8.1

$DS = "test1 test2 test3 test4 test5 test6 test7 test9 test10"


Dim $DM1, $DM2, $DS, $i

For $i = 1 To 500 Step 1
$DM1 = StringLeft ($DS, $i)

If StringRegExp($DM1, "(?x)\" & Chr(32)) Then
$DM2 = StringReplace ($DM1, Chr(32), "")
If Not ($DM2 = ("")) Then Ver()

$DS = StringReplace ($DS, $DM2, "")

EndIf

Next

Func Ver()
MsgBox (0, "", $DM2)
EndFunc


MsgBox(0, "", "Bye!")

Share this post


Link to post
Share on other sites
water

And the question is?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
maxrealqnx

OR

$DS = "test1 test2 test3 test4 test5 test6 test7 test9 test10"

MsgBox (0, "", $DS)

Dim $DM1, $DM2, $DS, $i

For $i = 1 To 500 Step 1
$DM1 = StringLeft ($DS, $i)

If StringRegExp($DM1, "(?x)" & Chr(32)) Then
$DM2 = StringReplace ($DM1, Chr(32), "")
If Not ($DM2 = ("")) Then Ver()

$DS = StringReplace ($DS, $DM2, "")

MsgBox (0, "", $DS)

EndIf

Next

Func Ver()
MsgBox (0, "", $DM2)
EndFunc


MsgBox(0, "", "Bye!")

Share this post


Link to post
Share on other sites
water

I don't know what you try to achieve with your script and what kind of problem you have.

We need more information to help you.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
maxrealqnx

And the question is?

Hi!

The test10 result is wrong :(

Edited by maxrealqnx

Share this post


Link to post
Share on other sites
water

Which result do you get and what do you expect?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
maxrealqnx

Which result do you get and what do you expect?

I want to show each of them individually.

Share this post


Link to post
Share on other sites
water

Doesn't this script do the same?

$DS = "test1 test2 test3 test4 test5 test6 test7 test9 test10"
Global $asResult = StringSplit($DS, " ")
For $i = 1 To $asResult[0]
    MsgBox(0, "", $asResult[$i])
Next
MsgBox(0, "", "Bye!")

  • Like 1

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
water
:D
  • Like 1

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
maxrealqnx

Hi again everyone

Please help me again. Can I make run any function with the value ? Best regards :ILA2:

Dim $FN1

$FN1 = "Test1"

$FN1()

;Test()

Func Test()
MsgBox(0, "", "Success!")
EndFunc ;==>Test

Share this post


Link to post
Share on other sites
water

Use

Call($FN1)

  • Like 1

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

No big deal :rolleyes:


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

Good news of the day ^_^

So it's time to leave the office and have a nice weekend!

  • Like 1

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

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  

×