Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UNIQUEID in the SCX file

Status
Not open for further replies.

cj001

Programmer
Oct 3, 2001
145
US
Hello

How is the UNIQUEID in the SCX file created?

Thanks!
CJ
 
CJ,
To add to Darrell's speculation, in a form, when you create (or add) the first control, it appears that sys(2015) is called, Subsequent new controls get a value that is just one larger. It doesn't appear that sys(2015) is repeatedly called.

Rick
 
I believe we are talking about to different things.

I'm referring to the UNIQUEID that you see if you were to browse an SCX.

EXAMPLE (in command window):

Use c:\test.scx
Browse




Thanks!
 
believe we are talking about to different things.

I'm referring to the UNIQUEID that you see if you were to browse an SCX.

I believe the answers given to you are correct, it is using SYS(2015). Have you tried ?

Code:
 ? sys(2015)

Same structure.



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
If I do as suggested I only receive 1 value and I'm not sure what that value belongs to.
If I do a browse this value doesn't refer to any of the objects listed.

Which is why I believe that we all are talking about two different things.

:)
 
If I do as suggested I only receive 1 value and I'm not sure what that value belongs to.
If I do a browse this value doesn't refer to any of the objects listed.

Can you then explain what it is your are trying to achieve?
Your original question asked
"How is the UNIQUEID in the SCX file created?".

The answer is simply "When you create a form with the form designer, VFP uses SYS(2015) to assign a unique ID number to each field of the table that makes up your form."

For example you you use the SYS(2015) repeatedly you will notice that the value changes every time you hit the enter key, because the value is base on the current time of your PC which changes all the time.




Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
CJ001

To explain further, here is the SYS(2015) function in VFP code, if that helps you understand.
Code:
MESSAGEBOX(SYS2(DATETIME()))
FUNCTION SYS2(tDateTime)
LOCAL nMilliSecs,nDays,cBase36,cSys2016
IF VARTYPE(nMilliSeconds)<>'N'
	nMilliSeconds=0
ENDIF
nMilliSecs=(HOUR(tDateTime)*3600+MINUTE(tDateTime)*60+SEC(tDateTime))*1000+nMilliSeconds
nDays=TTOD(tDateTime)-DATE(YEAR(tDateTime),1,1)+1+MOD(YEAR(tDateTime),100)*367
cBase36='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
cSys2015=''
FOR nCounter=1 TO 6
	cSys2015=SUBSTR(cBase36,MOD(nMilliSecs,36)+1,1)+cSys2015
	nMilliSecs=INT(nMilliSecs/36)
ENDFOR
FOR nCounter=1 TO 3
	cSys2015=SUBSTR(cBase36,MOD(nDays,36)+1,1)+cSys2015
	nDays=INT(nDays/36)
ENDFOR
cSys2015='_'+cSys2015
RETURN cSys2015



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top