Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-22-2001, 05:45 AM
vergil vergil is offline
Registered User
vergil's Avatar
Join Date: Mar 2001
Posts: 1,408
vergil will become famous soon enough
Send a message via ICQ to vergil
If I assign an array 5 values then I do a blah=thisarray will blah still have all the values that thisarray did?

Example:
NPC Code:

myarray=1;
myarray[0]=1;
myarray[1]=5;
myarray[2]=67;

mything=myarray;



Will mything have all of the [] values also?
Reply With Quote
  #2  
Old 03-22-2001, 06:47 AM
kyle0654 kyle0654 is offline
-. .`
kyle0654's Avatar
Join Date: Mar 2001
Posts: 1,000
kyle0654 will become famous soon enough
NPC Code:

myarray=1;
myarray[0]=1;
myarray[1]=5;
myarray[2]=67;

mything=myarray;



mything would equal 1 after this code. It reads myarray and a variable, but will read myarray[#] as a position in the array myarray. If you want to copy an array to another array, do this:

NPC Code:

myarray = {1, 5, 67};
setarray myarray2, arraylen(myarray);
for (this.z = 0; this.z < arraylen(myarray); this.z++) {
myarray2[this.z] = myarray[this.z];
}



That should work. I haven't actually used setarray in a while though...I'm used to doing it the quick way like I did in the first line of that.
Reply With Quote
  #3  
Old 03-22-2001, 12:12 PM
vergil vergil is offline
Registered User
vergil's Avatar
Join Date: Mar 2001
Posts: 1,408
vergil will become famous soon enough
Send a message via ICQ to vergil
thanks a bunch
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:24 PM.


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