Computer Science Canada Gettings values to stay on a chart |
Author: | KawaNinja [ Sat Jan 31, 2004 11:26 am ] |
Post subject: | Gettings values to stay on a chart |
Hey, I was just starting this program to calculate the RPM/speed/torque of a cars preformance, and when I tell it to write the values on the chart on the screen, it never stays there and once it shows it, it disappears ![]() ![]() |
Author: | Thuged_Out_G [ Sat Jan 31, 2004 11:34 am ] |
Post subject: | |
well if you have the new turing, you can use View.UpdateArea(x,y,x1,y1) to jut update a certain area, and your values wont stay on screen because you must be using a cls after you put them to the screen |
Author: | KawaNinja [ Sat Jan 31, 2004 11:41 am ] |
Post subject: | |
hmm.. I tried that View.UpdateArea code, never worked. and i dont have a cls in my loop for it.. but the thing is, when it runs through the values only one column stays up there, which is the most recent written code and the others stay up there (but flashing) for the time that it runs through the values... its sort of hard to explain what it does ![]() |
Author: | KawaNinja [ Sat Jan 31, 2004 12:11 pm ] |
Post subject: | |
I have a feeling this is something really easy, but since im a n00b at turing i cant seem to crack it ![]() |
Author: | Tony [ Sat Jan 31, 2004 12:27 pm ] |
Post subject: | |
it would help to see your output code ![]() |
Author: | Cervantes [ Sat Jan 31, 2004 12:43 pm ] | ||||||||
Post subject: | |||||||||
View.Set ("graphics:offscreenonly") doesn't work. the correct syntax is
if you want something else in there (ie graphics), separate with a comma.
below is just something interesting I've noticed about View.Update and "offscreenonly" try this:
no view.Update, but still outputs it however, if you do this
it won't output it. it needs a View.Update.. strange huh? |
Author: | McKenzie [ Sat Jan 31, 2004 5:46 pm ] |
Post subject: | |
D'OC Student? Anyways, attach the code, I'll look at it. |
Author: | Cervantes [ Sat Jan 31, 2004 6:12 pm ] |
Post subject: | |
McKenzie wrote: D'OC Student
is that where you teach? and who are you talking to? ![]() |
Author: | McKenzie [ Sat Jan 31, 2004 6:23 pm ] |
Post subject: | |
Talking to kawaNinja. I used to Teach in Ajax (In Windsor now) at D'OC. The computer teacher at D'OC is still a very good friend of mine. |
Author: | Andy [ Sat Jan 31, 2004 6:40 pm ] |
Post subject: | |
so i'm guessing he's not the moron you told us about... |
Author: | McKenzie [ Sat Jan 31, 2004 6:43 pm ] |
Post subject: | |
No He's my student though (He has a marketing degree, I taught him to program, taught him MTG too ![]() |
Author: | Andy [ Sat Jan 31, 2004 6:46 pm ] |
Post subject: | |
LOL, well teach that to mr.levack... the thinks that bunkers are "GREAT!" |
Author: | Cervantes [ Sat Jan 31, 2004 7:10 pm ] |
Post subject: | |
haha were you playing starcraft in class? damn I wish my teacher were like you ![]() ![]() |
Author: | Andy [ Sat Jan 31, 2004 7:13 pm ] |
Post subject: | |
lol he doesnt let us play during class, not even during lunch anymore... after school is a different story tho |
Author: | KawaNinja [ Sat Jan 31, 2004 9:10 pm ] | ||
Post subject: | |||
Ok, I tried that View.Set stuff and it didnt work (the whole screen went white) but i took out the loops and it still went white.. so ![]() Quote: D'OC Student? and no i dont goto D'OC i goto Notre Dame.. not sure if you heard of it depending when you left (opened 3 years ago), but i know that there are quite a few teachers from D'OC that teach at my school now.. Mr O'Connor is one that i had just this past semester... when did you teach there? And finally my code... ok this is the hard part because my code is very long.. (but in not sure if all of it is necasary because i usually always take the long way in life ![]() (by the way, press the UP arrow and hold it down to view the values on the chart)
I am terribly sorry for all this code, its just the way its setup and stuff in order to show the values on the chart.. ![]() ![]() |
Author: | recneps [ Sat Jan 31, 2004 9:22 pm ] |
Post subject: | |
I'm not sure if this is right, but you're putting everything, and in my experience, when you put 2 things in different x positions, and same y, they get erased because put makes a huge blank space after the word. (I didnt have time to check the code, but i think thats whats happening) and thats not very long, ive seen longer posted ![]() |
Author: | KawaNinja [ Sat Jan 31, 2004 9:35 pm ] |
Post subject: | |
lol... yah i tried spacing out the words on the Y axis by 20 pixels apart, and it still did the same thing... ![]() ![]() |
Author: | recneps [ Sat Jan 31, 2004 9:40 pm ] |
Post subject: | |
try Font.Draw? I think you can use variables with that.... |
Author: | recneps [ Sat Jan 31, 2004 9:46 pm ] | ||
Post subject: | |||
here. Font.Draw them using this, where x is your variable to be put, and font is whatever you choose ![]()
|
Author: | KawaNinja [ Sat Jan 31, 2004 9:47 pm ] |
Post subject: | |
tried Font.Draw just now... it wont recognize my variable to draw on the chart, because the only thing you can put in the Font.Draw is a text string "put this" not the Font.Draw (rpm,...) ![]() anything else lol? |
Author: | recneps [ Sat Jan 31, 2004 9:51 pm ] |
Post subject: | |
did you read what i just posted? ![]() var x:int:=5 var font:int:=Font.New ("arial:12") Font.Draw((intstr (x)),100,100,font,7) intstr give you your variable (int) and turns it into a string so that font.draw can use it. (intstr (x)) changes var x to a string. ![]() |
Author: | KawaNinja [ Sat Jan 31, 2004 9:55 pm ] |
Post subject: | |
aw shit ... lol i totally skipped over that part i never saw it, sorry ![]() |
Author: | recneps [ Sat Jan 31, 2004 9:55 pm ] |
Post subject: | |
![]() |
Author: | KawaNinja [ Sat Jan 31, 2004 10:05 pm ] |
Post subject: | |
OMG ! IT WORKED ![]() |
Author: | Cervantes [ Sun Feb 01, 2004 11:00 am ] |
Post subject: | |
tony wrote: it would help to see your output code
![]() for future reference... tony was so right, I wasn't inclined in the least to take a look at your code. btw your sig is WAY too big... you can cut it down so there's just the motorcycle, that's still fairly big, but its toleratable. ![]() |
Author: | McKenzie [ Sun Feb 01, 2004 12:17 pm ] |
Post subject: | |
KawaNinja wrote: when did you teach there?
I taught at D'OC from '95 to '02 By the way the easy answer to your problem, put .. after all of your put statments. (e.g. put speed -> put speed..) I know you already solved it using Font.Draw. |
Author: | Cervantes [ Sun Feb 01, 2004 1:58 pm ] | ||
Post subject: | |||
that would just make the next put statement go on the next line, does it also make it so that it doesn't fill the rest of the line up with white space? |
Author: | shorthair [ Sun Feb 01, 2004 2:03 pm ] | ||
Post subject: | |||
thats wouldnt put hte next put on hte next line , it would put it on the same line
(..) represents , stay on teh same line , good for getting user input , if your gonna put things on the same line and not use .. , then you should put them from left to right |
Author: | Cervantes [ Sun Feb 01, 2004 2:23 pm ] | ||
Post subject: | |||
oops I didn't mean to say that ![]() then if you did it like that though, you'd have to do like so
calculating the # of spaces in there. the other way to do it is use locate and put statements so that you start at the end of the column (col not row) and work your way to the front. |
Author: | McKenzie [ Sun Feb 01, 2004 3:12 pm ] |
Post subject: | |
err ... look at the code. He locates before all of his puts. The result of the .. would be to prevent the \n from clearing off the rest of the line. |
Author: | shorthair [ Sun Feb 01, 2004 3:26 pm ] |
Post subject: | |
avtually what you would wwant to do is use the repeat command , and repeat " ", ths how to do it properly , |
Author: | Cervantes [ Sun Feb 01, 2004 3:32 pm ] |
Post subject: | |
nono Mckenzie that's just it I didn't look at his code because it was so long ![]() |
Author: | recneps [ Sun Feb 01, 2004 4:46 pm ] |
Post subject: | |
Its fixed people, hes got it working one way. You can stop posting suggestions which he probably doesnt understand ![]() |