Re: help please whit concatenation

new topic     » goto parent     » topic index » view thread      » older message » newer message

> how do i take a variable from a text box if my tex box is like  this
> }}}
<eucode>
> constant EDIT = create(MultiEditText,  "", 0, POPUP,4,38,180,
> 19,{0,WS_EX_CLIENTEDGE})
> </eucode
> and i want to use what i enter in this  text box to concatenate with what is
> typed in this other text box
> }}}
<eucode>
> constant EDIT1 = create(MultiEditText,  "", 0, POPUP,4,38,180,
> 19,{0,WS_EX_CLIENTEDGE})
> </eucode>
{{{

> can i concatenate them like this edit + edit1 = edited
> thanks

Here's an interactive version that does it on the fly:

include Win32Lib.ew

constant Main = create( Window, "Concatenation Demo", 0, Center,
Center, 320, 72, 0 )
constant Text1 = create( EditText, "", Main, 2, 2, 308, 20, 0 )
constant Text2 = create( EditText, "", Main, 2, 24, 308, 20, 0 )

sequence vLockedText
    vLockedText = ""

procedure Text1_KeyPress( integer pSelf, integer pEvent, sequence pParams )

    -- a key was pressed in Text1, append
    -- any entered text into Text2

    integer keyCode, shift
    sequence lTempText, lSelection

    keyCode = pParams[1]
    shift = pParams[2]

    lTempText = getText( Text1 )

    -- adjust for backspace
    if keyCode = VK_BACKSPACE then

    -- ignore return
    elsif keyCode = VK_RETURN then
        -- do nothing
		
    else
        lTempText &= keyCode
		
    end if

    setText( Text2, vLockedText & lTempText )

end procedure
setHandler( Text1, w32HKeyPress, routine_id("Text1_KeyPress") )

procedure Text2_LostFocus( integer pSelf, integer pEvent, sequence pParams )

    -- Text2 lost focus, lock in the
    -- text that was typed

    vLockedText = getText( Text2 )

end procedure
setHandler( Text2, w32HLostFocus, routine_id("Text2_LostFocus") )

WinMain( Main, Normal )


~Greg

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu