Grr... stupid put command things
Author |
Message |
Blade
|
Posted: Wed Mar 19, 2003 7:37 pm Post subject: Grr... stupid put command things |
|
|
for some reason i cant get my strings to move over, when i want them to, but the integers will ! i dont know of any other way to do this though...
as an example
what i'm trying to do is read 5 names, from a file, 5 marks, and 5 addresses and line them up in a table
as an example
John 123 Fake St. 86
Bill 45 Valley Ave 34
and so on...
but for some reason, i cant get strings to move over, and all that's readable from files are strings... |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Tony

|
Posted: Wed Mar 19, 2003 7:43 pm Post subject: (No subject) |
|
|
i donno... works for me. It adds extra spaces AFTER the string though.
code: |
put "":round(maxcol/2 - length("tony")/2), "tony"
|
that would put "tony" right in the center of the screen. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
 |
Asok

|
Posted: Wed Mar 19, 2003 7:48 pm Post subject: (No subject) |
|
|
You need to calculate the correct variable for :x x is not always equal to 20 it is equal to 20 minus the characters before so everything starts on the same line. |
|
|
|
|
 |
Blade
|
Posted: Wed Mar 19, 2003 7:56 pm Post subject: (No subject) |
|
|
well i think it still should move over, its not doing anything
edit:
haha i figured it out |
|
|
|
|
 |
Vicous
|
Posted: Thu Mar 20, 2003 11:11 am Post subject: (No subject) |
|
|
strings and numbers are aligned different, strings will put the extra spaces to the right, numbers put extra spaces to the right eg.
put "Hi":20,"bye"
gives you 18 spaces (20-# of letters)
Hi__________________bye
var number:int:=10
put number,"Bye"
gives you 18 spaces, the number 10 followed by the word bye
__________________10Bye
I hope this explains it
P.S. 1 underscore (_) equals 1 space, the forum edits out extra spaces |
|
|
|
|
 |
Blade
|
Posted: Thu Mar 20, 2003 11:32 am Post subject: (No subject) |
|
|
yea thanks, i was playin around with it and i figured it out... numbers have extra spaces before them, whereas strings have extra spaces after them  |
|
|
|
|
 |
|
|