Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Another IndexSeek BUG?
Message
From
27/11/2003 14:08:29
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Another IndexSeek BUG?
Miscellaneous
Thread ID:
00854073
Message ID:
00854073
Views:
52
I run into really weird bug (or is it a feature?) with using IndexSeeek function in a stored procedure assigned as default value for a field. In short, IndexSeek seems to clear all fields, previously filled in with default values.

To recreate the bug:

1) Create Test_StoredProcedures.prg file with following text in it:
function NewId
lparameters tcIndex
local lnId
lnId = 1
do while indexseek(lnId, .f., alias(), tcIndex)
lnId = lnId + 1
enddo
return lnId
endfunc

2) Create Test database and Test table in it:
create database test.dbc
append procedures from Test_StoredProcedures.prg
create table Test (Name C(20) default "Record # " + transform(recno()), ;
Id I default NewId('Id') primary key)

3) Try to add a new record to the table with APPEND BLANK or just by pressing {CTRL+Y} in Browse window. The Name field will be blank. Changing bufering mode or index type does not change the behavior. It is the same in VFP7 & VFP8. Weird, isn't it? Does anybody have an explanation?

Thanks.
Yuri Rudenko
MCSD, MCP
Next
Reply
Map
View

Click here to load this message in the networking platform