Guest pipo Posted March 2, 2005 Share Posted March 2, 2005 Hi all, this is my first post... please be indulgent ;0) Here is a problem that drives me nuts: I wrote a script to automate some complex photoshop procedure, in a part of it I pick up two parameters of an image, namely $width and $height (I checked, the values I get are OK), then I need to compare these two values and take some decision, so: if $height>$width then foo1.... else foo2... endif I *know* that $height IS bigger than $width because I displayed the values... and though, foo2 is executed!!!!! (to double check I calculated $height/$width and displayed it in a MsgBox in foo2... I got foo2 executed and outputing $height/$width=1.2....) TIA for any input Pipo. Link to comment Share on other sites More sharing options...
DaLiMan Posted March 2, 2005 Share Posted March 2, 2005 Can you show us what your values look like? Link to comment Share on other sites More sharing options...
Guest pipo Posted March 2, 2005 Share Posted March 2, 2005 Okay... found out sorry for the hassle guys.... after trying everything and more I thought that my variables could be strings and not numbers.... it was enough to convert them before comparison.... Funny I had to work on that for 10 hours, sleep on it, post my message, look a fool and then find the solution... Thanks any way. pipo Link to comment Share on other sites More sharing options...
Blue_Drache Posted March 2, 2005 Share Posted March 2, 2005 Okay... found outsorry for the hassle guys.... after trying everything and more I thought that my variables could be strings and not numbers.... it was enough to convert them before comparison....Funny I had to work on that for 10 hours, sleep on it, post my message, look a fool and then find the solution...Thanks any way.pipo<{POST_SNAPBACK}>I've run into that myself. Don't feel bad. I had to wind up using StringFormat to force the numerical strings into decimal format after reading the data from a file....for about 2 hours I was wondering why a number wasn't returning true in a StringIsDigit() function. When I KNEW that the particular string was all digits at the time. I also like the fact if you use StringFormat to take an alpha-numeric string and try to force it into a digit format that it will fail quietly. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now