Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   Really long string lists. (https://forums.graalonline.com/forums/showthread.php?t=43261)

adam 03-07-2003 02:52 AM

Really long string lists.
 
Better support for exceptionally long strings would be nice.

At least until I find a way to keep track of 400+ bank accounts without having all thier names in a string.

You simply can't copy and paste when it gets that long, it cuts off the end.

Python523 03-07-2003 02:54 AM

bankaccount_account1
bankaccount_account2
etc

tlf288 03-07-2003 03:09 AM

heh, jagen put it perfect and simple. Have more then one string guY!

geez!



:asleep:

CheeToS2 03-07-2003 03:57 AM

it would still be a nice addition :X

tlf288 03-07-2003 04:08 AM

Quote:

Originally posted by CheeToS2
it would still be a nice addition :X
Graal c++ will have much better data storage, so no worries bah

adam 03-07-2003 09:05 PM

Quote:

Originally posted by Python523
bankaccount_account1
bankaccount_account2
etc

Sure you could do it that way. But you wouldn't be able to do things like, sort through them all and figure out what's where. Or automatically sort through them and check for empties and delete them. Or add interest automatically. Or easily list all the accounts in the bank and the total cash in the bank.

The accounts themselves are all in separate strings, it's just thier names that are in the one string. So the Bank npc can easily see what accounts it manages.

Python523 03-07-2003 11:59 PM

Quote:

Originally posted by adam


Sure you could do it that way. But you wouldn't be able to do things like, sort through them all and figure out what's where. Or automatically sort through them and check for empties and delete them. Or add interest automatically. Or easily list all the accounts in the bank and the total cash in the bank.

The accounts themselves are all in separate strings, it's just thier names that are in the one string. So the Bank npc can easily see what accounts it manages.

you could do
bankaccount_0=Account1,ammount in bank
bankaccount_1=asdfaccount,ammount in bank

this.flags=getflagkeys(bankaccount_);

in that example, this.flags = 0/{0,1};

i'm not sure if getflagkeys works serverside yet

G_yoshi 03-08-2003 12:11 AM

Quote:

Originally posted by adam


Sure you could do it that way. But you wouldn't be able to do things like, sort through them all and figure out what's where. Or automatically sort through them and check for empties and delete them. Or add interest automatically. Or easily list all the accounts in the bank and the total cash in the bank.

The accounts themselves are all in separate strings, it's just thier names that are in the one string. So the Bank npc can easily see what accounts it manages.

A good way to get a total value of funds is through a for() loop :p

NPC Code:

for (this.i=0; this.i<(maxaccounts); this.i++) {
setstring banktotoal,#v(strtofloat(#s(banktotal))+strtofloat (#s(bank_account#v(this.i)));
}



I'm not positive if that will work though. I've been away from Graal for a little too long :x

adam 03-08-2003 08:08 AM

Quote:

Originally posted by Python523

you could do
bankaccount_0=Account1,ammount in bank
bankaccount_1=asdfaccount,ammount in bank

this.flags=getflagkeys(bankaccount_);

in that example, this.flags = 0/{0,1};

i'm not sure if getflagkeys works serverside yet

I'll give it a try sometime, must have missed that function.

tlf288 03-08-2003 08:33 AM

Quote:

Originally posted by adam


must have missed that function.

You didn't miss it. Jagen just hangs out with Stefan all day :\

Kaimetsu 03-08-2003 09:19 AM

Hey, yo. I wouldn't make a separate string for each account - it just seems wasteful. I'd code a system that makes the account list automatically overflow into a new string when its length exceeds the limit. That way you can minimise the number of strings you're using.

Python523 03-08-2003 07:10 PM

Quote:

Originally posted by tlf288


You didn't miss it. Jagen just hangs out with Stefan all day :\

that is an old function o_O ive posted about it on these forums a few times too


All times are GMT +2. The time now is 09:10 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.