Jump to content
Sign in to follow this  
ricky

Compare string error

Recommended Posts

ricky

Hello,

I have the script below for the command lines, but with the command line "-labo", the string is compared but is not recognised in the if, why???

#include

Local $arrayChangelog[4][2] = [[3,3],[0,"labowst"],[0,"labo"],[0,"new"]]
Local $cmdlineb[5]

$cmdlineb[0] = 2
$cmdlineb[1] = "-labo"
$cmdlineb[2] = "/new"

changelog($arrayChangelog)
_ArrayDisplay($arrayChangelog)

Func changelog(Byref $array)

; $arrayChangelog[4][2] = [[3,3],[0,"labowst"],[0,"labo"],[0,"new"]] = array example

If $cmdlineb[0] > 0 Then

For $i = 1 to $cmdlineb[0]
For $j = 1 to $array[0][0]

if $cmdlineb[$i] = "changelog" or $cmdlineb[$i] = "-changelog" or $cmdlineb[$i] = "/changelog" Then
FileInstall("changelog.txt", @TempDir & "\changelog.txt", 1)
ShellExecuteWait("notepad.exe", @TempDir & "\changelog.txt", "", "open")
FileDelete(@TempDir & "\changelog.txt")
Exit
Endif

_ErrorMsg($cmdlineb[$i] & @crlf & "-" & $array[$j][1])
if $cmdlineb[$i] = $array[$j][1] or $cmdlineb[$i] = "-" & $array[$j][1] or $cmdlineb[$i] = "/" & $array[$j][1] Then
$array[$j][0] = 1
ElseIf $j = $array[0][0] Then
_ErrorMsg('Parameter : "' & $cmdlineb[$i] & '" not found.', 1)
Endif

Next
Next
Endif
EndFunc ;==>changelog

Func _ErrorMsg($message, $exit = 0, $time = 0)
MsgBox(48 + 262144, "Test" & " : Error!", $message, $time)

If $exit Then Exit

EndFunc ;==>_ErrorMsg

Thanks a lot for your help!!!

Edited by ricky03

Share this post


Link to post
Share on other sites
ricky

I found, I forgot an exiloop!!!

Share this post


Link to post
Share on other sites
FireFox

Hi,

Can you post the working script and add [sOLVED] to your topic title? ;)

Not that it will help me, but I'm not the only one here.

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

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  

×