ID:264823
 
Code:
proc/RefreshServers()
for(var/A in Servers)
var/Name = copytext(A,1,"|")
var/Address = copytext(A,"|","||")

var/list/Servers=list("Test Server | 127.0.0.1 ||")


Problem description: This is Oceans Code Problem week!

runtime error: bad text or out of bounds
proc name: RefreshServers (/proc/RefreshServers)
source file: Main.dm,6
usr: null
src: null
call stack:
RefreshServers()
: New()

Don't know if there's another problem. :0



copytext(text, number, number)

The 2 arguments after the first one in copytext are positions within the text, not parts of the text itself.
In response to Masschaos100
Well, then i will use Datums. Thanks.
In response to Ocean King
No point in that, you can still do it by doing this :

proc/RefreshServers()
for(var/A in Servers)
var/Name = copytext(A,1,findtext(A, "|"))
var/Address = copytext(A,findtext(A, "|")+1,findtext(A, "||"))

var/list/Servers=list("Test Server | 127.0.0.1 ||")
In response to Masschaos100
I prefer doing Datums for multiservers.

By the way, how do i call a Datum proc?
In response to Ocean King
Ocean King wrote:
I prefer doing Datums for multiservers.

By the way, how do i call a Datum proc?

You prefer using datums, yet you don't know how to use them properly?
In response to Ocean King
I'm fairly sure that you do not, actually, know what a datum is.

Messages between servers are text strings, not datums. Unless you plan on doing incredibly silly stuff with savefiles, you're going to have to use text strings, and datums aren't going to help you in the slightest, there.

As for your question: you use the . operator.
In response to Garthor
Cool! Was looking into the . operator. And Oceans Fail message is "I don't understand it" Woo Jk. I understand it.


Thanks Garthor.