forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


List index bug, or not?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sun Jul 23, 2006 12:04 pm    Post subject: List index bug, or not? Reply with quote

I was just playing some with the list commands and found this little "bug":

Code:
list create,1
list add,1,LIST1 A
list add,1,LIST1 B
list add,1,LIST1 C

list create,2
list add,2,LIST2 A
list add,2,LIST2 B
list add,2,LIST2 C
list add,2,LIST2 D
list add,2,LIST2 E

# Seek for fourth item
list seek,2,4

list assign,2,1

# You would expect the index number not to exceed 2, but it still is 4
info @index(2)

# This now won't work
info @item(2)

info @text(2)


But when you use the delete command, the list index dóes change:

Code:
list create,1
list add,1,LIST2 A
list add,1,LIST2 B
list add,1,LIST2 C
list add,1,LIST2 D
list add,1,LIST2 E

# Seek for fourth item
list seek,1,4

list delete,1
list delete,1

# You would expect the index number not to exceed 2, and it doesn't
info @index(1)

# Will display the 2nd item
info @item(1)

info @text(1)


Do you think the not-changing index number when using "list assign" is a bug, or is it something done on purpose?

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
WidgetCoder
Contributor
Contributor


Joined: 28 May 2002
Posts: 126
Location: CO, USA

PostPosted: Mon Jul 24, 2006 5:03 pm    Post subject: Reply with quote

I would call that a bug.. the "assign" command should reset the index to zero since the command does overwrite the original list data. Maintaining the index value of the previously stored list could serve no useful purpose.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group