Welcome! Log In Create A New Profile

Advanced

HReadSeekFirst

Posted by Robin Lane.pcs.crosspost 
Robin Lane.pcs.crosspost
HReadSeekFirst
May 04, 2009 03:17PM
Hello all,
I am using HReadSeekFirst to search a column in a table of a hyperfile Database.
If a match is found I want to assign the other corresponding column fields to variables without displaying any of the data to the user. (ie searching on column 1, and a match found in row 3 - I want to assign column 2 row 3 to a variable etc)

I assume that I am missing something silly & would appreciate any assistance.

Many thanks
Robin.

Message forwarded from pcsoft.us.windev
Piet van Zanten
Re: HReadSeekFirst
May 04, 2009 03:42PM
Hi Robin,

Indeed, this is very basic ;-):
if hReadSeekFirst(Myfile,MyKey,myValue) then
   MyFile.Item1=MyVar1
   MyFile.Item2=MyVar2
   etc.
   hmodify(MyFile)
end
Regards,
Piet
John Marrone
Re: HReadSeekFirst
May 05, 2009 10:38AM
Robin
You can set the columns you don't want the user to see to visible = false. Their is a checkbox for this in the GUI tab in the description window. These fields will still be available to you at run time to be able to assign their values to your variables. Or threw source code ie:

<code>
TableName.ColumnName..Visible = False.
</code>

I would put this code in the windows initialization event.
Benny Depre.pcs.crosspost
Re: HReadSeekFirst
May 06, 2009 08:34AM
Hoi Robin

verry simple

layout of the file
------------------

index
field1 (key)
field2
field3

--------------

program

colum2 is string
colum3 is string
HReadSeekFirst(filename,field1,Searchvalue)
if filename.field1=Searchvalue then
colum2=filename.field2
colum3==filename.field3
end

bye

Benny

Message forwarded from pcsoft.us.windev
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: