09-11-2003, 08:46 AM
i need help to understand several things w/in the code we get from our teacher. . .for example:
CLS
DIM char(127)
PRINT "Enter the string and press the ENTER key"
LINE INPUT text$
FOR count=1 to LEN(text$)
char(ASC(MID$(text$,count,1)))=char(ASC(MID$(text$,count,1))) +1
NEXT count
PRINT
PRINT
PRINT "There are "; LEN(text$); " characters in the string"
PRINT
PRINT "The breakdown is. . ."
FOR count=32 to 127
IF char(count) > 0 then
IF count=32 then
PRINT "Sp"; " - ";
ELSE
PRINT CHR$(count); " - ";
END IF
PRINT char(count); " - ";
PRINT USING "###.#"; (char(count)/LEN(text$))*100
END IF
NEXT count
my question is all the bold parts. i dont understand what the first bold is doing exactly. he told us but i forgot. i dont get char(count), how/why is count w/in parenthesis along side the char variable. it might be a stupid question but i dont see it. . .as you can see i am having trouble w/arrays.
CLS
DIM char(127)
PRINT "Enter the string and press the ENTER key"
LINE INPUT text$
FOR count=1 to LEN(text$)
char(ASC(MID$(text$,count,1)))=char(ASC(MID$(text$,count,1))) +1
NEXT count
PRINT "There are "; LEN(text$); " characters in the string"
PRINT "The breakdown is. . ."
FOR count=32 to 127
IF char(count) > 0 then
IF count=32 then
PRINT "Sp"; " - ";
ELSE
PRINT CHR$(count); " - ";
END IF
PRINT char(count); " - ";
PRINT USING "###.#"; (char(count)/LEN(text$))*100
END IF
NEXT count
my question is all the bold parts. i dont understand what the first bold is doing exactly. he told us but i forgot. i dont get char(count), how/why is count w/in parenthesis along side the char variable. it might be a stupid question but i dont see it. . .as you can see i am having trouble w/arrays.