Computer Science Canada

is there any way to make this smaller?

Author:  n00b.skillz [ Wed Dec 20, 2006 11:02 am ]
Post subject:  is there any way to make this smaller?

okay well i was just wondering if there is a more efficient way to make a user input display into another font (other than default in real time (as they are typing it in) than this code that i have found on one of the forums
code:

function gets (xpos, ypos, font, clr : int) : string
    var a : string (1)
    var word : string := ""
    loop
        getch (a)
        exit when a = '\n'
        if word ~= "" and ord (a) = 8 then
            word := word (1 .. * -1)
        else
            if a ~= "\b" then
                word += a
            end if
        end if
        cls
        Font.Draw (word, xpos, ypos, font, clr)
    end loop
    result word
end gets

var name : string := ""
put "Please enter your name"
name := gets (12,375, Font.New ("times new roman:10" ),red)

Author:  ericfourfour [ Wed Dec 20, 2006 3:15 pm ]
Post subject: 

If you want a more efficient way you can always try my getter.


: