Post Reply 

If-Types

May 26, 2011, 16:14
Post: #1
If-Types
Hello,
i wonder how to use an if-statement on a string.

Code:
(if(not textvar "Right to left")
do something..
)

does not work.

I have a variable with the value of an SF-OPTION field (like "Left to right", "Right to left" etc...)

Regards.
Find all posts by this user
Quote this message in a reply
May 26, 2011, 17:50
Post: #2
RE: If-Types
Can't help... I avoided the problem by coding in Python Smile It works at least as well as Scheme, if not better.

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
May 26, 2011, 20:33
Post: #3
RE: If-Types
well, i think, i will try in python too.
Find all posts by this user
Quote this message in a reply
May 27, 2011, 15:27 (This post was last modified: May 27, 2011 15:31 by paynekj.)
Post: #4
RE: If-Types
if you want to compare strings in script-fu you can use the string=? function:

Code:
(if (string=? sharpModeString "Refocus")
      (plug-in-refocus RUN-INTERACTIVE aimg adraw 5.0 0.8 0.0 0.5 0.01)
    )

If you continue with script-fu and/or Python then you might find the resources listed here useful:
http://gimpchat.com/viewtopic.php?f=9&t=724
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Need to know list of valid parameter types for scripting oconzer 6 511 Feb 18, 2014 00:38
Last Post: oconzer
  Where can I get a list of registered enum types used for "SF-ENUM" argument? Tagussan 0 1,011 Feb 1, 2011 10:53
Last Post: Tagussan

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS