Loading ...
Sorry, an error occurred while loading the content.

Re: [radio-dev] Behaviour of table.rename()

Expand Messages
  • Seth Dillingham
    ... It s because table names are not case sensitive, so Radio is comparing the current name with the name you re trying to change it to and seeing them as the
    Message 1 of 4 , Aug 21, 2002
    • 0 Attachment
      On 8/21/02, mowerm said:

      >for adrItem in adrItems
      > if( nameOf( adrItem^ ) != string.lower( nameOf( adrItem^ ) ) )
      > table.rename( adrItem, string.lower( nameOf( adrItem^ ) ) )
      >
      >but it doesn't actually seem to change the name.
      >
      >Does anyone else see this?

      It's because table names are not case sensitive, so Radio is comparing the current name with the name you're trying to change it to and seeing them as the same, so it doesn't do anything.

      If you want to change a name to lower case, you have to chane it to something else first, like this:

      local ( name = string.lower( nameOf( adrItem^ ) ) )
      table.rename( adrItem, name + "_" )
      table.rename( @parentOf( adrItem^ )^.[ name + "_" ], name )

      Seth
    • mowerm
      Hi Seth, ... Thanks for the tip. Regards, matt
      Message 2 of 4 , Aug 22, 2002
      • 0 Attachment
        Hi Seth,

        --- In radio-dev@y..., Seth Dillingham <seth@m...> wrote:
        > If you want to change a name to lower case, you have to chane it
        to something else first, like this:
        >
        > local ( name = string.lower( nameOf( adrItem^ ) ) )
        > table.rename( adrItem, name + "_" )
        > table.rename( @parentOf( adrItem^ )^.[ name + "_" ], name )
        >

        Thanks for the tip.

        Regards,

        matt
      Your message has been successfully submitted and would be delivered to recipients shortly.