Topic: help with Num_Eval (1 of 7), Read 37 times
Conf: Program develop.,Color syntax
From: Steve Rawling
Date: Friday, October 22, 2004 05:25 AM

If I have the following in a buffer
2001111 +03
and I have the cursor at the number 2

then in command mode I write the following

OI() EV() OI(clear)

I was expecting the buffer to change to the following
2001114
2001111 +03

but nothing is happening

in fact if I have just
EV() I was expecting 2001114 to be returned in command mode but that doesn't happen either.

Steve

 


Topic: Re: help with Num_Eval (2 of 7), Read 37 times
Conf: Program develop.,Color syntax
From: Fritz Heberlein
Date: Friday, October 22, 2004 06:47 AM

> If I have the following in a buffer
> 2001111 +03
> and I have the cursor at the number 2
>
> then in command mode I write the following
>
> OI() EV() OI(clear)
>
> I was expecting the buffer to change to the following
> 2001114
> 2001111 +03
>
> but nothing is happening


What about:

#1=num_eval()
num_ins(#1,NOCR) ?

Fritz


--

Dr. Friedrich Heberlein, Akad. Direktor
Seminar f. Klassische Philologie,
KU Eichstätt-Ingolstadt / Bayern
D-85071 Eichstaett

 


Topic: Re: help with Num_Eval (3 of 7), Read 39 times
Conf: Program develop.,Color syntax
From: Steve Rawling
Date: Friday, October 22, 2004 07:32 AM

>What about:
>
>#1=num_eval()
>num_ins(#1,NOCR) ?

Thanks, that works

I don't knoe why the other didn't

steve

 


Topic: Re: help with Num_Eval (5 of 7), Read 39 times
Conf: Program develop.,Color syntax
From: Ted Green
Date: Friday, October 22, 2004 02:25 PM

At 07:32 AM 10/22/2004, you wrote:
>>What about:
>>
>>#1=num_eval()
>>num_ins(#1,NOCR) ?
>
>Thanks, that works
>
>I don't knoe why the other didn't

For one thing, "ev()" is not a valid command.
Also, Fritz's way is cleaner.

Ted.

 


Topic: help with Num_Eval (4 of 7), Read 36 times
Conf: Program develop.,Color syntax
From: Christian Ziemski
Date: Friday, October 22, 2004 08:15 AM

On 10/22/2004 5:25:46 AM, Steve Rawling wrote:
>If I have the following in a buffer
> 2001111 +03
>and I have the cursor at the number 2
>
>then in command mode I write the following
>
> OI() EV() OI(clear)
>
>I was expecting the buffer to change to the following
> 2001114
> 2001111 +03
>
>but nothing is happening
>
>in fact if I have just EV() I was expecting 2001114
>to be returned in command mode but that doesn't happen either.

The command EV() doesn't exist.
You are meaning Num_Eval() or NE(), right?

So it should read:
OI() .NE() OI(clear)

Please note the dot in front of NE()!
It prints the result to the console and then via OI() into the buffer.

Christian

 


Topic: help with Num_Eval (6 of 7), Read 36 times
Conf: Program develop.,Color syntax
From: Steve Rawling
Date: Friday, October 22, 2004 09:39 PM

>The command EV() doesn't exist.
>You are meaning Num_Eval() or NE(),
>right?

Yeah, sorry about that Ted, twas late at night:-(

what I meant to say was that when the buffer cursor position is at a numeric expression then the following does not work
oi() ne() oi(clear)



>
>So it should read:
>OI() .NE() OI(clear)
>
>Please note the dot in front of NE()!
>It prints the result to the console and
>then via OI() into the buffer.

Aahhh.......ohhhhhhh ...wooooow!!!... I like that trick with the dot:-)

I can see though that Fritz's way is better for me because I don't wish to insert a CR and it allows nocr to be used.


Thanks Christian

Steve

 


Topic: Re: help with Num_Eval (7 of 7), Read 37 times
Conf: Program develop.,Color syntax
From: Ted Green
Date: Friday, October 22, 2004 10:21 PM

At 09:40 PM 10/22/2004, you wrote:
>what I meant to say was that when the buffer cursor position is at a numeric expression then the following does not work
>oi() ne() oi(clear)

Steve:

You are going to get strange results when you try to read something that you are modifying at the same time. That is why Fritz's method was cleaner.

Ted.