Sign in to follow this  
Followers 0
Swimming_Bird

If Not not working properly

4 posts in this topic

Is it my code that is messing up?

If Not StringRight ( $wpipath , 1 ) = "\" Then $wpipath = $wpipath & "\"
If Not StringRight ( $installs , 1 ) = "\" Then $installs = $installs & "\"

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

why not just use

If StringRight ( $wpipath , 1 ) <> "\" Then $wpipath = $wpipath & "\"
If StringRight ( $installs , 1 ) <> "\" Then $installs = $installs & "\"
Edited by B3TA_SCR1PT3R

[right][font="Courier New"]...Run these streets all day, I can sleep when I die.[/font] [/right]

Share this post


Link to post
Share on other sites

Is it my code that is messing up?

If Not StringRight ( $wpipath , 1 ) = "\" Then $wpipath = $wpipath & "\"
If Not StringRight ( $installs , 1 ) = "\" Then $installs = $installs & "\"
Are you sure that the last character in $wpipath and $installs is not a cr or lf or crlf or space or something else?

Try:

$var = StringRight($installs,1)
msgbox(1,"Last char is:",$var)

...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

Share this post


Link to post
Share on other sites

Are you sure that the last character in $wpipath and $installs is not a cr or lf or crlf or space or something else?

Try:

$var = StringRight($installs,1)
msgbox(1,"Last char is:",$var)
$wpipath and $installs are strings read from an ini file. so afaik they couldnt have any of those things, a space may be in there, but i dont mind it erroring out if someone messes up the ini file and puts a space there.

why not just use

If StringRight ( $wpipath , 1 ) <> "\" Then $wpipath = $wpipath & "\"
If StringRight ( $installs , 1 ) <> "\" Then $installs = $installs & "\"
worked great thanks, i didnt realize <> meant not equal to. i didnt even know <> existed.

/me is not a programer

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