Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 How to make a white box with a blue background that i can write in.
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Mr.White




PostPosted: Sat Mar 26, 2011 12:56 pm   Post subject: How to make a white box with a blue background that i can write in.

What is it you are trying to achieve?
How to make a white box with a blue background that i can write in. I want a blue background (55) and yellow writing at the top left and a white box in the lower right that i can write the characters and initials but when i try to do both either the text in the top left gets a white background over it or the lower right gets a blue background. Also how to get the initials of a name when i ask for the first and last name.


What is the problem you are having?
I try to use Draw.FillBox but it does not go over the text.


Describe what you have tried to solve this problem
changing the order of the commands


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)


Turing:


var FirstName, LastName : string

put "What is your first name?"
get FirstName
put "What is your last name?"
get LastName
cls
colourback (55)
for row : 1 .. 25
    for column : 1 .. 80
        put " " ..
    end for
end for
Draw.FillBox (500,0,639,100,0)
locatexy (510,90)
colourback (0)
put length (FirstName) + length (LastName), " characters"

locate (1, 1)
colour (yellow)
put "Hello " ..
colour (yellow)
put FirstName ..
put " " ..
colour (yellow)
put LastName




Please specify what version of Turing you are using
4.1.1
Sponsor
Sponsor
Sponsor
sponsor
Raknarg




PostPosted: Sat Mar 26, 2011 2:36 pm   Post subject: RE:How to make a white box with a blue background that i can write in.

Well, you could use Font.Draw instead. If you try to use strings and draw statements at the same time, i find it screws up a lot.
Raknarg




PostPosted: Sat Mar 26, 2011 2:49 pm   Post subject: Re: How to make a white box with a blue background that i can write in.

so you would have someting like this, i think:

Turing:

var FirstName, LastName : string
var font : int := Font.New ("Ariel:10")

put "What is your first name?"
get FirstName
put "What is your last name?"
get LastName
cls
colourback (55)
for row : 1 .. 25
    for column : 1 .. 80
        put " " ..
    end for
end for
Draw.FillBox (500, 0, 639, 100, 0)
locatexy (510, 90)
colourback (0)
put length (FirstName) + length (LastName), " characters"

Font.Draw ("Hello " + FirstName + " " + LastName, 0, maxy - 10, font, yellow)


Also, if you want to get the first initial, yo would use FirstName (1) and LastName (1).
Mr.White




PostPosted: Sat Mar 26, 2011 6:21 pm   Post subject: RE:How to make a white box with a blue background that i can write in.

ya, thanks alot man Smile
Lucas




PostPosted: Sat Mar 26, 2011 8:21 pm   Post subject: RE:How to make a white box with a blue background that i can write in.

instead of :
for row : 1 .. 25
for column : 1 .. 80
put " " ..
end for
end for
why not just use:
Draw.FillBox (0, 0, maxx, maxy, 55)
?
Raknarg




PostPosted: Sat Mar 26, 2011 8:59 pm   Post subject: RE:How to make a white box with a blue background that i can write in.

Cause i was only adding the Font statement Razz
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: