Saving different IDs in the same variable.
#1

First of all I just want to say thank you for reading this.

What I am trying to do is something like make a loop and something like
new pickupid_%d = CreatePickup(bla bla bla)
First of all.. is it even possible? I want the %d to become the house ID which is basically the value of ' i ' in the loop.
If it is not, any suggestions?
Reply
#2

I found a way, I just use

new pickupid = CreatePickup(blabla);
and then I store the pickupid in the house's file.
Next time I won't make a thread before thinking the hell out of me.

Sorry and thank you for the help.
Reply
#3

...and thats a clever way of doing it - if you WOULD have created an array for it (like new HousePickupID[10000]), and the pickupids for houses started at 4000, then the first 4000 cells of the array contained just zeros.
using an additional house variable as pointer (holding the pickupid as value stored in it) is the fastest way. no linear/binary search, just an extra [].

btw, i didnt expect this topic to "solve itself" - a good sign that i started my day reading this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)