Hi Dave

Just a small help for you

your code contains if x=y.......end

this will set the variable x to being y before testing it!

you need to use the comparison operator == (2 equals)
as in:  if x == y .... end

dave wrote:
I have a shoes program (below this message) where what i want to do is to allow the user to enter data into 1 of 2 edit_lines.


From the user pressing enter i then check which edit_line has something in it and setup parameters for a SQL statement that 's in a class called dbase that's inside a module called sqlite3_calls.


this tho is of no importance yet as i cannot capture the enter key!


Note I'm only wanting to get 1 of the two edit_lines working then get the
other done once i working based on the solution for the 1st one.


Currently what happens is that the program runs but when I alt+/ to see the debug window after my shoes screen appears i see a comment saying pressed enter! when in fact i haven't press a dam thing except .


did a search on keypress and edit_line and keypress but nothing i saw really gave me any hints.


Dave.


code as it stands is below.....


require "sqlite3_calls.rb"


Shoes.app do
# extend Dbase #for the purposes isolation I've commented out this line

stack :top =>5, :height => 90 do
title "Find Customer Info", :align => 'center'
end


flow :top => 100, height => 70 do
para strong "Customer nos"
@custno = edit_line :width => 50 :focus


para strong 'customer name'
@custname = edit_line :width => 270
end
if keypress = :enter or keypress = "\n"
debug 'pressed enter !'
if @custno != nil
para 'cust number has a value !'
# rows = rec_to_find('customers', 'cust_nos', @custno) # please ignore
else
if @custname != nil
para 'cust name has a value !'

end

end
end


flow :top => 550 do
para strong 'data return shown here!'
end


end
------------------------------------------------------------------------


No virus found in this incoming message.
Checked by AVG - www.avg.com Version: 8.5.339 / Virus Database: 270.12.60/2166 - Release Date: 06/09/09 18:08:00

Reply via email to