octave-maintainers
[Top][All Lists]
Advanced

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

Prompting the user for input


From: Daniel Kraft
Subject: Prompting the user for input
Date: Wed, 21 Sep 2011 15:51:11 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

after I was quite busy the last weeks, I finally want to come back to
profiling and implement at least an interactive "browser" for the
hierarchical profile before features are frozen next month (IIRC).

For that, I want to give a "command prompt" to the user, similar to
the one for debugging (like "profile> ").  What is the best way to do
so from within .m file functions?  It would be nice if that would
integrate well into the look-and-feel of the ordinary Octave CLI.

I found "input (prompt, 's')" which seems to be almost what I want;
however, it does not handle Ctrl-D (EOF) well; this shows an error,
while I would ideally just want to be notified that input is EOF
instead of a new command so that I can return to the ordinary Octave
prompt.  Is there a way to "catch" EOF with input?

Apart from that, there seem to be only the C stdlib like functions
available for input (like fgetl).  They appear to handle EOF fine
(return -1), but I can't use "fgetl (stdin ())" on the interactive
Octave CLI -- is there a way to read with fgetl from stdin even in
interactive mode, or is all I can do use "input"?

Thanks!  Yours,
Daniel

- -- 
http://www.domob.eu/
OpenPGP: 3BA2 3DDB 7758 F010 BDAB 0DCF 527E 79BA A3B5 3998
- --
Done:  Arc-Bar-Cav-Kni-Ran-Rog-Sam-Tou-Val-Wiz
To go: Hea-Mon-Pri
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOeevPAAoJEFJ+ebqjtTmY+pkP/21/1zEk6qkNz+A0DYaP+t6n
i4Uwk6PmK/g1k8qDScnWW0/yAeXeT55BhGTnO2TilnVU+XYDtIUxbIePX2hm44MV
P1rLfn/FUH531DUfqPeIjGUefShxkj3iTw+iBvXqGovLwMLfUiuZ8RSRO8VwDDtI
PW3QWz8mbTq2HWdR0BxAJl3dEAEr6FO6omjy8G5b+VKlPMZFmiPx+WTgbqtyIZwS
W19Xmqs+vIbVk3rByIESNcin/vrDW0GKMSfD7YOSHrdqvhO6Npx7MvQf4LWZdZrx
a48klep6bXRrFXLpZnECPPQYRXhpVGTgs2+cIOwnpGsYNvnYhwqxV1a6HipXbIFb
fQQHg4/HOR65orCO4SGu8a9gXQVG4oP/9qjA1WwCSOwbugw/xJtIJL6PHlmw78c5
UhM79wo9fYbkes16dBLEfSwvFHqh5D38FijwfGwplSMfRb3aXjgOgYUgoQSgUdPr
8ObbuuqWZyihAzwK+pEGKv0k65cbBeISbJCxV9YuhwY1YPeM5qh5AnT6anjtFNlV
HKraX7AXggT/UbaHV7H9tLHVU2Qb9t2hW/D67O4cqV8fyd3G556vhuTejWjP3qE0
RhtRn6TErptXrVM1WBWaTO2hejNmou+wV2ul41WXdBagx2gkwQKk3SSc10ddY/SR
I0IYguftCMQyg7UqxPbk
=dT87
-----END PGP SIGNATURE-----

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]