Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Terms Hardwarekey evade token problem

Anonymous
Not applicable
Hello,
I have problem with these terms.
I want, when user have harware key (licence key) wrote in my database, so he can use it.
But I want to put it eventuality use token key from .txt files in C:/ and evade 1.term (Licence key)
Can you help me, where I have misstake or how do that....
---------
IF licencekey=key1 or key2 GOSUB "program"
IF licencekey<>key1 or key2 GOSUB "token"
end
"token":
Token=0001
ch1=OPEN("TEXT","C:/token.txt","SEPARATOR=',',MODE=RO, FULLPATH")
n=INPUT(ch1, 1, 1,value)
IF value=token GOTO "program"
IF value<>token GOTO "end"
CLOSE (ch1)

"program":
........
........
"end":
.......
3 REPLIES 3
Laszlo Nagy
Community Admin
Community Admin
Try this:
IF (licencekey=key1 OR licencekey=key2) THEN
    GOSUB "program" 
ENDIF
IF (licencekey<>key1 AND licencekey<>key2) THEN
    GOSUB "token" 
ENDIF
Or:
IF (licencekey=key1 OR licencekey=key2) THEN
    GOSUB "program" 
ELSE
    GOSUB "token" 
ENDIF
You should check the GDL Reference Guide for correct syntax.
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac28
Anonymous
Not applicable
Thank by answear, but value stop work it.
What to put parameters - TEXT, number?
Laszlo Nagy
Community Admin
Community Admin
Try this:
Token="0001"
This way the variable Token will be a Text, just like that value you read from the Text file.

Also, make sure that licencekey, key1, and key2 variables are all the same type. I am not sure if these are number or text but you can make them either.
You can make them text by
licencekey=""
key1=""
key2=""
or a number by:
licencekey=0
key1=0
key2=0
at the beginning of the script.
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac28

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!