Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with script

Status
Not open for further replies.

TonCoronel

Programmer
Dec 1, 2003
37
NL
I found this link on teh internet and want to use it in the application I am currently building.

http://www.justpbinfo.com/pbtips/dwscrollsearch2.asp

I just dont understand the last part

[qoute]Note: ue_goto_row(row) is just an event that tries to 'go to row' and
returns 1 if sucessfull.
It checks if row is within the min and max number of rows for the
DataWindow,
performs the This.SetRow(row), This.ScrollToRow(row) etc checking that their
return values
are OK and so on.

You can just replace this with your code for going to the row found. [/qoute]

Could someone maybe make this event for me???

 
Event: ue_goto_row(row)

long ll_return

if row >0 and row <= dw_list.rowcount() then
ll_return = dw_list.setrow(row)
if ll_return = 1 then
ll_return = dw_list.scrolltorow(row)
end if
else
ll_return = -1
end if

return ll_return
 
Tnx but it still doesnt work. In the ue_key_up event it gives me an error that the FUNCTION ue_goto_row doesnt excist!

this is how my event is defined
ue_goto_row(long row) returns long

the code that I use is the same as in that link I posted
 
Hm never mind I placed the event on the SLE instead of the datawindow. but now it still doesnt work. everytime I enter something in the SLE it gives me an error message: unknown type of argument to function.
 
I changed the code and removed the ue_goto_row event.
I still kept the getfocus event.

It works great now it only doest display a message when it cant go to a row but it just changes the SLE text to red:D

Here is my code some things are in dutch sorry



string ls_search_string
long ll_row_num
ll_row_num = dw_bedrijven.GetRow()


ls_search_string = 'Match(Upper(String(klanten_klant_naam)), &quot;' + Upper(Right(This.text,len(This.text))) + '&quot;)'

If key = keyDownArrow! Then
This.SelectText ( len(This.text) + 1, 0 )
ll_find_row = ll_found_row + 1
If ll_find_row > dw_bedrijven.RowCount() Then ll_find_row = dw_bedrijven.RowCount() + 1
ll_found_row = dw_bedrijven.Find(ls_search_string, ll_find_row, dw_bedrijven.RowCount() + 1 )
ElseIf key = keyUpArrow! Then
This.SelectText ( len(This.text) + 1, 0 )
If ll_found_row = 0 Then ll_found_row = dw_bedrijven.RowCount() + 2
ll_find_row = ll_found_row - 1
ll_found_row = dw_bedrijven.Find(ls_search_string, ll_find_row, 1)
If ll_find_row = 0 Then ll_found_row = 0
Else
ll_find_row = 1
ll_found_row = dw_bedrijven.Find(ls_search_string, ll_find_row, dw_bedrijven.RowCount() + 1 )
End If


If ll_found_row > 0 Then
This.TextColor=RGB(1,78,98)
Else
This.TextColor=RGB(255,0,0)
End If

If ll_found_row > 0 Then
dw_bedrijven.ScrollToRow(ll_found_row)
dw_bedrijven.SelectRow(0, False)
dw_bedrijven.SelectRow(ll_found_row, True)
End If


This.SetFocus()

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top