Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Tech Support (https://forums.graalonline.com/forums/forumdisplay.php?f=7)
-   -   Problem with reading file. (https://forums.graalonline.com/forums/showthread.php?t=71601)

xXziroXx 01-21-2007 03:51 PM

Problem with reading file.
 
I encountered a problem when trying to read a file with loadLines.. or well, the same thing worked one day earlier and I havent touched it.


Heres how the file looks like:

PHP Code:

"White Pants",1,Pants,White,0,0,
 Sacks
,1,Sacks,0,0,0,

and its named xXziroXx_items.arc. Here's how I try to read it, along with what it returns:

PHP Code:

temp.items.loadLines(temp.folder player.account "_items.arc");

temp.items echoes:

Sacks,"White Pants" 


I asked Skyld about it, and he did not know what could be wrong. I tried restarting the NPC-Server and /refreshfilelist but none worked. He suggested I post it on the forum so that Stefan can see it.

Need help asap.

Chandler 01-21-2007 03:55 PM

Quote:

Originally Posted by xXziroXx (Post 1267102)
Need help asap.

Are you saving vars or just lines? If you're saving vars use
HTML Code:

object.savevars("folderPlace", type);
loading them use
HTML Code:

object.loadvars("folderPlace", type);
If you're not using save/loadvars, why're you using loadlines?

xXziroXx 01-21-2007 03:57 PM

I use loadLines because it works exactly like I need it to work. And you missed where I wrote:

"the same thing worked one day earlier and I havent touched it."

Admins 01-21-2007 04:01 PM

I would guess there is some other code between the loadlines and echo? If you just do loadlines and echo it should display more

xXziroXx 01-21-2007 04:02 PM

There's not. The row below the loadLines was the echo().

Chompy 01-21-2007 05:36 PM

Quote:

Originally Posted by xXziroXx (Post 1267102)
I encountered a problem when trying to read a file with loadLines.. or well, the same thing worked one day earlier and I havent touched it.


Heres how the file looks like:

PHP Code:

"White Pants",1,Pants,White,0,0,
 Sacks
,1,Sacks,0,0,0,

and its named xXziroXx_items.arc. Here's how I try to read it, along with what it returns:

PHP Code:

temp.items.loadLines(temp.folder player.account "_items.arc");

temp.items echoes:

Sacks,"White Pants" 


I asked Skyld about it, and he did not know what could be wrong. I tried restarting the NPC-Server and /refreshfilelist but none worked. He suggested I post it on the forum so that Stefan can see it.

Need help asap.

You could make the arc file look like:

PHP Code:

Item1="White Pants",1,Pants,White,0,0,
Item2
=Sacks,1,Sacks,0,0,0,

I dunno if it is that you are trying to do, but if it was like that, you could use loadvars

Chandler 01-21-2007 05:39 PM

Quote:

Originally Posted by Chompy (Post 1267131)
You could make the arc file look like:

PHP Code:

Item1="White Pants",1,Pants,White,0,0,
Item2
=Sacks,1,Sacks,0,0,0,

I dunno if it is that you are trying to do, but if it was like that, you should use loadvars

Hehe^^

Chompy 01-21-2007 05:55 PM

Quote:

Originally Posted by Chandler (Post 1267133)
Hehe^^

:cool:

xXziroXx 01-21-2007 08:16 PM

Yes, I could do that, but at the moment I dont. Stefan, any thoughts on what the problem is?

Chompy 01-21-2007 08:27 PM

The only thing I see that it don't load arrays with load lines,
so maybe making it like:

PHP Code:

"White Pants":1:Pants:White:0:0:
 Sacks
:1:Sacks:0:0:0:

and then use obj.tokenize( ":");

only thing I can think of..

(loadlines don't like comma's I think :))

xXziroXx 01-22-2007 03:31 AM

What part of it all working fine a day ago did you all miss? Not me, not Skyld, not anyone Ive asked know why its not working. Might have anything to do with the NPC-Server being mysteriously offline when I logged on RC today?

Like I said, I do NOT know why it STOPPED working all the sudden, so can you please take a look at it Stefan?


All times are GMT +2. The time now is 12:40 PM.

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