1. get_key() with backspace

It was basically said:
I need to use get_key() to read a string. I want to delete a character on the sc
reen
if backspace (Key 8) is pressed.

Read carefully as this may help a lot of people,

Using DOS32, 14 when sent to the screen deletes the character before it.

I think it works like that with puts(), I can't check as my net connections via
a
mac, as you may have guessed. eg puts(1, 14) Otherwise the only thing you can do
is use position() to put a NULL over the character that was removed and move the
cursor back using position( )  again. It's annoying but it works.
I have no Idea about WIN32 as I don't have WIN4+.

---
Sincerely,
Mathew Hounsell
Mat.Hounsell at mailexcite.com




Free web-based email, Forever, From anywhere!
http://www.mailexcite.com

new topic     » topic index » view message » categorize

2. Re: get_key() with backspace

Thanks, will try later when I'm not wasting my time doing other things.

Wave!
Kevin

Mathew Hounsell wrote:

> It was basically said:
> I need to use get_key() to read a string. I want to delete a character on the
sc
> reen
> if backspace (Key 8) is pressed.
>
> Read carefully as this may help a lot of people,
>
> Using DOS32, 14 when sent to the screen deletes the character before it.
>
> I think it works like that with puts(), I can't check as my net connections vi
a
> a
> mac, as you may have guessed. eg puts(1, 14) Otherwise the only thing you can
do
> is use position() to put a NULL over the character that was removed and move t
he
> cursor back using position( )  again. It's annoying but it works.
> I have no Idea about WIN32 as I don't have WIN4+.
>
> ---
> Sincerely,
> Mathew Hounsell
> Mat.Hounsell at mailexcite.com
>
> Free web-based email, Forever, From anywhere!
> http://www.mailexcite.com

new topic     » goto parent     » topic index » view message » categorize

3. Re: get_key() with backspace

(Oops, I sent this to Pete by mistake -- sorry)
At 11:30 PM 3/27/98 -0800, you wrote:

>Kevin Sieger wrote:
>>
>> Yes, there is an easier way to input a string, but the use of the
>> get_key allows me to implement real time in a multi-user rpg I'm
>> developing.

Ok, here are some answers:
  1. puts(1,14), as someone suggested, does not work
  2. the following code does:

----------------------------------------------------------------------------
---------
-- getstr()     routine to implement b/s char while using get_key()
----------------------------------------------------------------------------
---------
sequence test

function getstr()
 object s
 sequence buffer
  buffer = {}
  while 1 do
    s = get_key()
      if s > -1 then
         if s = 8 then
            if length(buffer) > 0 then
            buffer = buffer[1..length(buffer)-1] -- clip last char
            puts(1,13)            -- move to start of line
            puts(1,buffer & ' ')  -- overlay last char with a space
            puts(1,13)            -- move to start of line
            puts(1,buffer)        -- put the updated string
            end if                    -- also puts cursor in right place
         elsif s = 13 then        -- exit on c/r
            puts(1,"\n")
            exit
         else puts(1,s)           -- other chars just accumulate
            buffer = buffer & s
         end if
      end if
    end while
 return buffer
end function

test = getstr()
puts(1,test)
----------------------------------------------------------
--Visit my Euphoria programming web site:--
--http://www.mindspring.com/~mountains   --
----------------------------------------------------------

new topic     » goto parent     » topic index » view message » categorize

4. Re: get_key() with backspace

------ =_NextPart_000_01BD5BBD.DB44AEE0

I put together a simple program that will do field input. You can find it on the
 Euphoria web page.

-- David Cuny

------ =_NextPart_000_01BD5BBD.DB44AEE0

new topic     » goto parent     » topic index » view message » categorize

5. Re: get_key() with backspace

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

At 09:25 AM 3/30/98 -0800, you wrote:
>I put together a simple program that will do field input. You can find it on
the
> Euphoria web page.
>
>-- David Cuny
>
>Attachment Converted: "e:\eudora\attach\Re get_key() with backspace"
>

David,

Hmmmm, I just went to the Euphoria web-page and could find the above. Are you
talking about yhe 'Main' Euphoria page (RDS) or yours (if you have one).


-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.5.5 for non-commercial use <http://www.nai.com>
Comment: Major Havoc

IoIXf5DdixmyAM8003y7rYvI
=RJuO
-----END PGP SIGNATURE-----


Ralph
aka Major Havoc

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu