>I have coded the AUTO NUMBERING... I am having problems...
> When I append and I go get my next number, my code
>says:
> SELECT counter.dbf
> etc...
>
> this works.. when I SAVE.. My code says:
> SELECT counter.dbf
> etc..
>
> Debug stops me at the SELECT and says..
> ALIAS NOT FOUND.
>
> The second time I say SELECT, I have problems.
> I have added the counter.dbf to the database
> and to the datavironment.
>help..
>
Heres my copy for auto numbering. It is a stored procedure in the master
dbc.
FUNCTION NewID(tcAlias)
LOCAL lcAlias, ;
lcID, ;
lcOldReprocess, ;
lnOldArea
lnOldArea = SELECT()
IF PARAMETERS() < 1
lcAlias = UPPER(ALIAS())
ELSE
lcAlias = UPPER(tcAlias)
ENDIF
lcID = ""
lcOldReprocess = SET('REPROCESS')
SET REPROCESS TO AUTOMATIC
IF !USED("SETUP")
USE WORK!SETUP IN 0
ENDIF
SELECT SETUP
IF SEEK(lcAlias, "setup", "key_name")
IF RLOCK()
lcID = setup.value
REPLACE setup.value WITH ;
STR(VAL(ALLT(lcID)) + 1, LEN(setup.value))
UNLOCK
ENDIF
ENDIF
SELECT (lnOldArea)
SET REPROCESS TO lcOldReprocess
RETURN lcID
hope this helps.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only