<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.us.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>1 Mar 2017 15:41:56 Z</lastBuildDate><pubDate>28 Feb 2017 23:09:28 Z</pubDate><description>I have been working on this all day and cannot find a way to solve it, although it seems it should be easy.&#13;
For historical reasons I would like to use my own unique ID's for a filed in one file rather than AutoID's.&#13;
The problem is that I can't seem to perform any operations on a file while it is in use in an edit window although I experimented with HSavePosition/HRestorePosition unsuccessfully.&#13;
&#13;
So... i created a LOCAL Procedure and used an alias&#13;
PROCEDURE New_Comp_ID()&#13;
sID is string&#13;
dsCompAlias is Data Source&#13;
IF HAlias(RBL_COMP,dsCompAlias) THEN&#13;
	 sID = Upper(Left(EDT_CompNAME,3))&#13;
	sExt is string&#13;
	i is int&#13;
	IF HReadSeek(dsCompAlias,"COMP_ID",sID) THEN  // BUT THIS LINE DOESN'T WORK!&#13;
		WHILE dsCompAlias.COMP_ID [= sID&#13;
			HReadNext()&#13;
		END&#13;
		HReadPrevious()&#13;
		sExt = Right(dsCompAlias.COMP_ID,3)&#13;
		i = Val(sExt) +1&#13;
		sID = sID +NumToString(i, "03d")&#13;
	ELSE&#13;
		sID += "001"&#13;
	END&#13;
END&#13;
&#13;
RESULT sID&#13;
&#13;
I have probably been working on this too long and I need some help. Surely someone else has dealt with this problem!&#13;
&#13;
--&#13;
Garry</description><ttl>30</ttl><generator>WEBDEV</generator><language>en_US</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/60666-new-unique-problem/read.awp</link><title>New Unique ID problem</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster><item><author>gallen.dbmc</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/60666-new-unique-problem-60668/read.awp</comments><pubDate>1 Mar 2017 15:41:56 Z</pubDate><description>Perhaps I am solving the wrong problem.&#13;
First: I am doing no locking.&#13;
&#13;
The code for opening my edit window is:&#13;
PROCEDURE MyW…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/60666-new-unique-problem-60668/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/60666-new-unique-problem-60668/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/60666-new-unique-problem/read.awp">New Unique ID problem</source><title>Re: New Unique ID problem</title></item><item><author>fromweb</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/60666-new-unique-problem-60667/read.awp</comments><pubDate>1 Mar 2017 10:40:55 Z</pubDate><description>Hi Garry,&#13;
&#13;
&gt; The problem is that I can't seem to perform any operations on a file&#13;
&gt; while it is in use in an edit window alth…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/60666-new-unique-problem-60667/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/60666-new-unique-problem-60667/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/60666-new-unique-problem/read.awp">New Unique ID problem</source><title>Re: New Unique ID problem</title></item></channel></rss>
