10
20
30
40
50
60
70 :
80
90
100 :
110
120
130 :
140 DEFFNReg_Rd(K$):LOCAL K%,R%,L%,T%,I$,V$,B%
150 I$=K$:REPEAT:K%=INSTR(I$,"\"):IFK%:I$=MID$(I$,K%+1)
160 UNTILK%=0:K$=LEFT$(K$,LENK$-LENI$-1)
170 SYS "RegOpenKeyEx",&80000001,K$,0,&20001,^K% TO R%
180 IF R%=0 THEN
190 SYS "RegQueryValueEx",K%,I$,0,^T%,0,^L%:DIM B% LOCAL L%
200 SYS "RegQueryValueEx",K%,I$,0,^T%,B%,^L% TO R%
210 IF R%=0:B%?(L%-1)=0:V$=$$B%
220 SYS "RegCloseKey",K%
230 ENDIF
240 =V$
250 :
260 :
270
280
290 :
300 DEFPROCReg_Wr(K$,V$):LOCAL K%,D%,R%,I$
310 I$=K$:REPEAT:K%=INSTR(I$,"\"):IFK%:I$=MID$(I$,K%+1)
320 UNTILK%=0:K$=LEFT$(K$,LENK$-LENI$-1)
330 SYS "RegCreateKeyEx",&80000001,K$,0,"",0,&F003F,0,^K%,^D% TO R%
340 IF R%=0 THEN
350 SYS "RegSetValueEx",K%,I$,0,1,V$,LENV$+1
360 SYS "RegCloseKey",K%
370 ENDIF
380 ENDPROC
390 :
400 :
410
420
430 :
440 DEFPROCReg_Del(K$):LOCAL K%,R%
450 SYS "RegCreateKeyEx",&80000001,K$,0,"",0,&F003F,0,^K%,0 TO R%
460 IF R%=0 THEN
470 SYS "RegDeleteTree",K%,0 TO R%
480 SYS "RegCloseKey",K%
490 ENDIF
500 ENDPROC