RE: How to "printf" text and variable contents?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


> On Behalf Of paulsm1021
> Can anybody PLEASE tell me how to do a simple "printf" in Script-Fu?
> Thank you in advance!
> (define (script1)
>   (let*
>     (
>       (x 2)
>     )
>     ; This just prints "script-fu: 1: x="; it doesn't print value of x
>     (gimp-message "1: x=" x)

There's no automatic string conversion nor string concatenation in
script-fu. You have to write it explicity, thus:
(gimp-message (string-append "1: x=" (number->string x)))
is the way to do it.

>     ; This causes an "execution error"
>     (gimp-message
>       (cons "2: x=" x)
>     )

cons is only for concatenating lists.

>     ; This also causes an "execution error"
>     ; (gimp-message x)

Again, x need to be converted to string: (gimp-message (number->string x))


Yahoo! Groups Links

<*> To visit your group on the web, go to:

<*> To unsubscribe from this group, send an email to:

<*> Your use of Yahoo! Groups is subject to:

[Index of Archives]     [Gimp Developers]     [Gimp Users]     [Yosemite News]     [Epson Inkjet Printers]     [Scanners]     [Gimp's Home]     [Steve's Art]

&hbsp; Powered by Linux