Re: trying to use InputField as a continually attentive string input
- To: mathgroup at smc.vnet.net
- Subject: [mg108843] Re: trying to use InputField as a continually attentive string input
- From: ADL <alberto.dilullo at tiscali.it>
- Date: Sat, 3 Apr 2010 06:08:42 -0500 (EST)
- References: <hp4gcv$7nh$1@smc.vnet.net>
I obtained the effect you are looking for by using Null instead of ""
as a return value of procstring:
procstring[ins_String]:=
If[
StringLength[ins]>1 && StringTake[ins,-2]=="do",
AppendTo[msgs,StringTake[ins,{1,-3}]]; Null,
ins
];
ADL
On 2 Apr, 12:20, mkr <mileskra... at gmail.com> wrote:
> I am trying to set up some interactive code where I issue short
> instruction strings to drive some additional dynamic code.
>
> My hope was to use an InputField into which I could continuously type
> these short instructions, with a given character sequence ("do" in the
> code below) acting as the trigger (I was guessing that using the
> [Enter] key might not work).
>
> There are a couple of immediate problem behaviors that I observe:
> first, when InputField input contains spaces, the cursor keeps getting
> moved to inside of the string, second, after ending a string with
> "do", the cursor ends up to the right of the InputField, requiring a
> [<-] keypress to get the cursor back into the InputField.
>
> I am using 7.0.1 on XP. Code follows:
>
> ....
>
> Miles