Re: [Gimp-user] reading from txt file



Hi.

charlysangel (forums gimpusers com) wrote:
I've tried to read from file with code below

(let* ((fd (fopen filename)))
   (let*    (
      (c (fread 1 fd))
      (res "")
      )
   (while (and c (not (equal? c " ")))
      (set! res (string-append res c))
      (set! c (fread 1 fd)))
      (if (equal? res "")
         ()
         (cons (string->number res) ())
      )
   )
   (gimp-message (string-append "PosX: " (number->string res)))
)

I do not understand why it returns :"Error: eval: unbound variable: res "

The inner let*-Block declaring the "res" variable is closed in the line
immediately before the gimp-message call.

Hence "res" is no longer available when evaluating the line with
gimp-message, resulting in the error message you see.

Bye,
         Simon
-- 
              simon budig de              http://simon.budig.de/


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