Re: Help please

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

Rangel, Hebert Rogelio wrote:
> 
> 	
> CAn any one help me and tell me how to do mat operations in euphoria i want to
> get
> de result and dtorit in a file and then get that number from that file and use
> it for
> othe operation something like this:
> 
> }}}
<eucode>
>
> -----------------------------------------------------------------------------------------------
> Window Window1
> global constant Window1 = create( Window, "The Window", 0, Default, Default,
> 280, 80+ 19, 0 )
> global constant OK = create( PushButton, "OK", Window1, 180, 20, 56, 28, 0 )
> global constant uno = create( EditText, "", Window1, 28, 24, 116, 20, 0 )
> ---------
> object p1
> object p2
> object p3
> procedure OK_onClick ()
> p1 = open("file.txt", "u")
> p2 = getText(uno)
> p3 = uno + 56.36
> puts(p1,p3)
> end procedure
> onClick[OK] = routine_id("OK_onClick")
> <font color="#330033"></eucode>
{{{
</font>
>
> -----------------------------------------------------------------------------------------------
> 
> THEN OTHER EXW FILE WILL CALL THE NUMBER IN FILE.TXT TO USE IT LIKE THIS:.
> 
> }}}
<eucode>
> object p1
> object p2
> object p3
> object p4
> object p5
> procedure OK_onClick ()
> p1 = open("file.txt", "r")
> p2 = getText(dos)
> p3 = gets(p1)
> p4 = p2 * p1
> p5 = open("data.txt", "a")
> puts(p5,p4)
> flush(p5)
> end procedure
> onClick[OK] = routine_id("OK_onClick")
> </EUCODE>
> 
> 

To load and save information  in EditTexts and text files see my program 
"program maker"
 in the Archives. (The program after you run the first program, you will see)

To do math you need to convert text to decimal. I use:
global function getdec(sequence seq) --returns a decimal given a sequence
atom de
sequence value_string
  value_string=value(seq[1..length(seq)])
 de = value_string[2]
return de
end function


Don Cole
SF

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

Search



Quick Links

User menu

Not signed in.

Misc Menu