Check tag type

I have used the following code to determine the type of each tag in my eWON:

FOR i% = 0 TO NB% - 1
    SETSYS Tag, "load",-i%
    name$= GETSYS TAG,"Name"
    PRINT GETSYS TAG,"Type"
NEXT i%

Using that code I can see in the console the number associated with each type, e.g. 1 = Float, 0 = boolean, 6 = string.

However, when I use this code I receive a syntax error message:

FOR i% = 0 TO NB% - 1
    SETSYS Tag, "load",-i%
    name$= GETSYS TAG,"Name"
    type% = GETSYS TAG,"Type"
    PRINT type%
NEXT i%

The following code produces a different error, mixed string&num operation … IF GETSYS TAG,“Type” = 6 THEN PRINT “STRING”:

FOR i% = 0 TO NB% - 1
    SETSYS Tag, "load",-i%
    name$= GETSYS TAG,"Name"
    IF GETSYS TAG,"Type" = 6 THEN PRINT "STRING"
NEXT i%

Is there a way to retrieve the tag type number and use it somehow in the code, such as assigning it to a variable? What am I missing?

Can you provide a back up with support files? So that i can review the complete script?

Actually I figured it out in the interim. It seems the variable name type% was the culprit. Even the name type$ would not work. I changed the code to the following and it worked:

FOR i% = 0 TO NB% - 1
    SETSYS Tag, "load",-i%
    name$= GETSYS TAG,"Name"
    tagtype$ = GETSYS TAG,"Type"
    PRINT tagtype$
NEXT i%

Thanks for the offer to help.

Topic closed due to inactivity.