It is currently Thu Jul 18, 2019 2:14 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: ReturnValue for PopListPosition() + ChangeCurrentElement()
PostPosted: Thu May 16, 2019 9:49 am 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 13, 2010 3:45 pm
Posts: 861
Most commands that change the position pointer of a LinkedList return the pointer to the new element. Unfortunately this is not the case for:
  • PopListPosition()
  • ChangeCurrentElement()
    Even if the new element is specified in the parameter here, a return value would be useful for a better code and for reasons of symmetry to other list commands. The parameter can e.g. come from a stack and should be stored in a global pointer after changing the position pointer.

For the same reasons, the commands
  • ClearList()
  • FreeList()
  • ResetList()

should have a return value of zero so that a pointer can be deleted by the return value.

_________________
sorry for my bad english


Top
 Profile  
Reply with quote  
 Post subject: Re: ReturnValue for PopListPosition() + ChangeCurrentElemen
PostPosted: Thu May 16, 2019 6:55 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Dec 23, 2003 3:54 am
Posts: 1624
+1
Agree, if possible. They already seem to return some integer values (???) which maybe are being used somehow internally...

But I like the idea. If you have the opportunity to return a convenient value, do it.

I like to return #Null on freeing too, like:
Code:
*MyObject = CreateObject()
; do some stuff
*MyObject = FreeObject(*MyObject) ; now #Null


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


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

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye