Computer Science Canada instr/strint |
Author: | Mr. T [ Mon Mar 21, 2005 1:59 pm ] | ||
Post subject: | instr/strint | ||
if i converted the variable score in:
and i need to convert it back...what is the syntax of strint? |
Author: | Naveg [ Mon Mar 21, 2005 2:01 pm ] |
Post subject: | |
strint(string) ![]() |
Author: | Mr. T [ Mon Mar 21, 2005 2:07 pm ] |
Post subject: | |
doesnt work..thats why im asking ![]() |
Author: | Flikerator [ Mon Mar 21, 2005 3:19 pm ] |
Post subject: | |
I know how to Intstr but not Strint :/ If you want to know how to Instr ill explain it. |
Author: | mike200015 [ Mon Mar 21, 2005 3:21 pm ] | ||
Post subject: | |||
u cant jus use strint.. u gotta reset ur variable to an int.. u gotta do it like this:
that should work |
Author: | Mr. T [ Mon Mar 21, 2005 4:18 pm ] | ||
Post subject: | |||
thnx, it good to know for the future...but instead i just rearranged my code so i dont need strint..... still the one problem i have left is that, before the exit point opens up... for some reason, you get a random 100 points out of nowhere...can someone run my program, and find out why its doing that
|
Author: | Naveg [ Mon Mar 21, 2005 6:38 pm ] | ||
Post subject: | |||
mike200015 wrote: u cant jus use strint.. u gotta reset ur variable to an int.. u gotta do it like this:
that should work that doesnt do anything....all you did there was change score to a string, then back to an int, then assign it back to score... like...score=1, score="1",score=1.....lol |
Author: | Mr. T [ Mon Mar 21, 2005 6:40 pm ] |
Post subject: | |
even though i found a way around it... i just wanted to try what u said...by taking out the unnecessary instr ...and i got an error ------------------------------ still the problem im having is with an unwanted random increase in points...can anyone see where the problem lies? |
Author: | Cervantes [ Mon Mar 21, 2005 6:54 pm ] | ||
Post subject: | |||
Vladimir wrote: mike200015 wrote: u cant jus use strint.. u gotta reset ur variable to an int.. u gotta do it like this:
that should work that doesnt do anything....all you did there was change score to a string, then back to an int, then assign it back to score... like...score=1, score="1",score=1.....lol Nonetheless, his point is clear: strint is a function, not a procedure. Therefore, you must assign strint (i : int) : string to some variable. All that is needed is to change the name of the variable being assigned to. Also, instead of changing score from 1 to "1" and back to 1, the program would crash. if score is an int, score cannot possibly be "1". Likewise, if score is a string, score cannot possibly just be 1. |
Author: | Mr. T [ Mon Mar 21, 2005 6:58 pm ] |
Post subject: | |
i understand that now. thnx. but to move back on topic...cough.... |
Author: | Bacchus [ Mon Mar 21, 2005 7:39 pm ] | ||
Post subject: | |||
ok here ya go, stop ur whining ![]()
|
Author: | Token [ Mon Mar 21, 2005 7:45 pm ] | ||||
Post subject: | |||||
actually Bacchus, i beat ya to it ![]() all i did was change this
to this
and it seemed to work. |
Author: | Mr. T [ Mon Mar 21, 2005 7:51 pm ] |
Post subject: | |
i declare the winner to be..... well, you two can fight to death, and last man standing wins. ![]() |
Author: | Token [ Mon Mar 21, 2005 7:59 pm ] |
Post subject: | |
well i'll settle for a tie, i showed u first on msn but Bacchus posted first lol... ![]() ![]() ![]() |
Author: | Bacchus [ Mon Mar 21, 2005 8:05 pm ] |
Post subject: | |
![]() nah, anyhow you should make sure that ur if statment isnt screwed. i would add in brackets personally cause then theres no confusion wheather its (this color or this color) & boolean is off, or this color or (this color and boolean off) |
Author: | Mr. T [ Mon Mar 21, 2005 8:59 pm ] |
Post subject: | |
Bacchus wrote: ![]() nah, anyhow you should make sure that ur if statment isnt screwed. i would add in brackets personally cause then theres no confusion wheather its (this color or this color) & boolean is off, or this color or (this color and boolean off) smart thinking |