echo( removeField( "Field1" TAB "Field2", 1 ) ); Field1^1 It doesn't remove the field, it just sets it to "1" ? Is that righ"> removeFIeld() bugged | Torque Game Engine | Forums | Community | GarageGames.com

Game Development Community

removeFIeld() bugged

by Bryan "daerid" Ross · in Torque Game Engine · 04/22/2002 (10:53 pm) · 1 replies

here's some console code to demonstrate the problem:

==>echo( removeField( "Field1" TAB "Field2", 0 ) );
Field2
==>echo( removeField( "Field1" TAB "Field2", 1 ) );
Field1^1

It doesn't remove the field, it just sets it to "1" ?

Is that right? why?

#1
04/24/2002 (11:27 am)
Looks like there are a couple of bugs there.

To fix, have a look at removeUnit in consoleFunctions.cc. Where it has this:
if(!sz && !string[sz])
      return ret;
replace with this:
if(string[sz] == 0) {               // if that was the last...
      if(string != start) {
         ret[string - start - 1] = 0;  // then kill any trailing delimiter
      }
      return ret;                      // and bail
   }
I'll check to make sure this doesn't break existing uses of that code and then get it into the TGE head.