Welcome! Log In Create A New Profile

Advanced

recornumber not found

Posted by devi.pcs.crosspost 
devi.pcs.crosspost
recornumber not found
July 23, 2008 04:30PM
help for hrecnum
try to delte a record based on the recordnumber by using hrecnum.
hrecnum doesnt view the true recordnumber. is seems it displays the idetifier.


code:

recnum is int
recnum = Listselect(Combo_box)
info (recnum)

recnum = HrecNum()
info (recnum)

______________
in both cases same number .. not real recordnumber

what is wrong???

thanks for help

Message forwarded from pcsoft.us.windev
Piet van Zanten
Re: recornumber not found
July 23, 2008 10:46PM
Hi Devi,

I assume you are using lists based on a file or query.
I have never used listboxes for deleting records, so I don't know if like browsing tables records are automatically deleted by listdelete. (don't think so)
As for your code:
ListSelect returns the subscript of a list, not the recordnumber.
hRecNum without a file name returns the recordnumber of the file last used by a h function. I think you'd better use hRecNum with a filename as parameter (in all cases).

If you still want to delete records from a listbox, a solution could be to use a memory list.

In the details tab of the list check the "returns the value specified woith glink" option.
for all MyFile on MyKey
    ListAdd(MyList,MyFile.MyField+gLink(hRecNum(MyFile))
end
gLinkActivate(MyList)
Now MyList or MyList[subscript] returns the recordnumber.

HTH, best reagrds,
Piet




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: