
-----------------------------------
Chimaera
Tue Nov 11, 2003 9:18 pm

strint &lt;-&gt; intsr help
-----------------------------------
I'm having trouble with converting the numbers from integers to string even though I'm doing it the way the reference said it should be done. 


var num : int
var fnum : string

get num
for i : 1 .. num - 1
    num := num * i
end for
intstr (num) := fnum
put fnum



I don't understand where exactly my error is or what I'm doing wrong. Can someone please help me out?  :?: btw my program is just a figuring out the factorial powers of whole numbers from 1..user input in case anybody was wondering. [/code]

-----------------------------------
Mazer
Tue Nov 11, 2003 9:56 pm

Re: strint &lt;-&gt; intsr help
-----------------------------------
your problem is right here:

intstr (num) := fnum


with that line you are trying to assign assign a string to a string that holds a number (whatever number num ends up being at the time).

intstr converts an integer to a string
strint converts a string to an integer (you might want to use the strintok function first)

what i think you want is

num := strint (fnum)


of course that doesn't make any sense, especially considering fnum isn't defined. so maybe what i think you meant was

fnum := intstr (num)


-----------------------------------
Chimaera
Tue Nov 11, 2003 9:59 pm


-----------------------------------
thanks a bundle I finally got the program to work the way I wanted to because I reworded it the way you suggested.

-----------------------------------
Mazer
Tue Nov 11, 2003 10:04 pm


-----------------------------------
happy to help. here, have some bits.

**puts on bits-gun silencer**
 :snipe:

-----------------------------------
Tony
Tue Nov 11, 2003 11:18 pm


-----------------------------------
**puts on bits-gun silencer**

I still heard that :lol: I should ask dan to write up some code just to stop Mazer from recieving any bits :wink:

-----------------------------------
AsianSensation
Wed Nov 12, 2003 12:48 am


-----------------------------------
would it even matter?

Mazer will probably come up with Evasive Manuever II, and we'll all end up refilling ammo for his bit-gun anyways :lol:

-----------------------------------
Tony
Wed Nov 12, 2003 12:51 am


-----------------------------------
:lol: he should still be recieving bits for Evasive Manuever I :lol:

-----------------------------------
Mazer
Wed Nov 12, 2003 7:55 am


-----------------------------------
*sniff* you guys... you really love my shitty game that much... makes me feel all warm and tingly inside.
**farts**
oh... so that's what it was... nm  :wink:
