rem <- this next line should be included at the top of your source code -> include "system.oxh" proc example: GLOBAL name$(50) PRINT "Enter your name:" Edit name$ IF len(name$)<5 Print "name must be more than 4 characters" GET Stop ENDIF print Createid$:(name$) get ENDP proc Createid$:(input$) : rem <- function to create (reasonably) unique 8 character string from a name -> local n%,output$(8), newinput$(50),x&,y& rem <- Section to remove all punctuation n%=1 newinput$="" while n%="A") and (upper$(mid$(input$,n%,1))<="Z") newinput$=newinput$+upper$(mid$(input$,n%,1)) endif n%=n%+1 endwh rem End of section -> output$ = "" : rem <- clear string -> output$ = mid$(newinput$,4,1) : rem <- 1st character -> output$ = output$ + chr$(48 + mod&:(iabs(asc(right$(newinput$,1))-asc(right$(newinput$,2))) ,10)) : rem <- 2nd character -> output$ = output$ + chr$(48 + mod&:(loc(newinput$,"e"),10)) : rem <- 3rd character -> output$ = output$ + chr$(90 - mod&:(len(newinput$),10)) : rem <- 4th character -> rem <- 5th character begin x&=0 : y&=0 : n%=1 while n%<=len(newinput$) if mid$(newinput$,n%,1) = "A" : x&=x&+1 : endif if mid$(newinput$,n%,1) = "S" : y&=y&+1 : endif n%=n%+1 endwh output$ = output$ + chr$(48 + mod&:(x&+y&,3)) rem 5th character end -> output$ = output$ + chr$(64 + mod&:(asc(mid$(newinput$,3,1)) + asc(mid$(newinput$,4,1)) + asc(mid$(newinput$,5,1)) + 2,26)) : rem <- 6th character -> rem <- 7th character x& = loc(newinput$,"O")*6 output$ = output$ + chr$(mod&:( (x&*(asc(mid$(output$,2,1))-48))+9 ,26)+64) rem 7th character end -> rem <- 8th character x& = (mod&:(asc(mid$(output$,1,1)) * asc(mid$(output$,2,1)),asc(mid$(output$,6,1))-47) * asc(mid$(output$,7,1))) - asc(mid$(output$,6,1)) output$ = output$ + chr$(mod&:(x&,26)+64) rem 8th character end -> return output$ endp rem The easiest way to use this is as follows: rem 1. When your application starts, check its' configuration file for a name rem and code pair. If code$ = CreateID$:(name$) then the program is rem registered. If not (or there is no name & code pair) then it is not. rem 2. When the user registers the program, if the code is correct then write rem the name & code into the configuration file, and set the global variable rem of registered to true.