Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cannot write to the record because it is in use (Error 1
Message
From
31/10/2003 19:15:13
 
 
To
31/10/2003 16:39:03
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00844916
Message ID:
00845283
Views:
17
Here is that function.
FUNCTION NewID()
	LPARAMETERS tlcKeyField, tlnFieldSize 
	
	LOCAL lnNumberOfRecords, cx, i, key	 	
	
	IF EOF()
		lnNumberOfRecords = RECCOUNT()
		IF lnNumberOfRecords = 0
			RETURN REPLICATE("A", tlnFieldSize)
		ENDIF
		GO lnNumberOfRecords
		cx = &tlcKeyField
		SKIP 1
		
		FOR i = LEN(cx) TO 1 STEP -1
		 IF !SUBSTR(cx, i, 1) = 'Z'
		   key = SUBSTR(cx, 1, i-1) ;
		   + IIF((BETWEEN(ASC(SUBSTR(cx, i, 1)), 48, 121)), ;
		          CHR(ASC(SUBSTR(cx, i, 1)) +1), "A") ;
		          + REPLICATE("A", LEN(cx)-i)
		   i = 1
		 ENDIF
		ENDFOR
		
		RETURN key
 	ENDIF

ENDFUNC
In DefaultValue function call is: NewID("cid_child", 5)

>Hi, Boban-
>
>>I have found out why error happens.
>
>Well, you've narrowed down where the source of the problem is...
>
>>In a ChildTable table I have field with DefaultValue which is UDF that returns value for that field.
>>When I issue APPEND BLANK then it goes to that function to retrieve value for field and at the end of function on RETURN lcValue (value for field) error happens.
>>
>>When I removed UDF for DefaultValue it works, but I need that function for DefaultValue.
>>I notice that sometimes error happens and sometimes it let me to append with my value from UDF.
>
>It's impossible for me to even guess, not knowing what your UDF does. You'll need to look into that code to see what it does.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform