*      *      *      *      *      *      *      *      *      *      *      *      *      *      *      *
*
* 2018-01-15 - 
*
*      *      *      *      #> ver. 2018-01-15 <#       *     *BEZ HADA*     *      *      *      *      *


USE (gchom_path + "users") ORDER user_id noupdate

IF FILE(gchom_path + "user_spart.dbf")
    USE (gchom_path + "user_spart") IN 0
ELSE
    CREATE TABLE (gchom_path + "user_spart") FREE ;
           (username C(30), user_id C(3) NOCPTRANS, sparts C(33) NOCPTRANS, c_stredisk I, pin C(12) NOCPTRANS, idriadok I )
ENDIF 

SELECT user_spart
SET RELATION TO user_id INTO users
DELETE FOR EMPTY(users.user_id)
REPLACE ALL username WITH users.username
INSERT INTO user_spart (user_id, username) SELECT user_id, username FROM users WHERE user_id NOT in (SELECT user_id FROM user_spart)

INDEX on username TO (m.gcpri_path + "username")
BROWSE FIELDS user_id:R, username:R, sparts, c_stredisk, pin NODELETE NOAPPEND 
