Author Topic: Code Replacement handling of missing fields  (Read 3958 times)

Offline devenh

  • Sr. Member
  • ****
  • Posts: 435
    • View Profile
Code Replacement handling of missing fields
« on: April 05, 2009, 07:35:28 AM »
If I have the following code replacement text

AA   F1   F2   F3
BB   F1      F3

(there are two tabs between F1 and F3 for BB)

The CR for AA works fine.  For BB, however, the fields are evaluated as follows:

Field1: F1
Field2: F3
Field3: --

Shouldn't be:

Field1: F1
Field2: --
Field3: F3

Deven

Windows 4.6

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24730
    • View Profile
    • Camera Bits, Inc.
Re: Code Replacement handling of missing fields
« Reply #1 on: April 07, 2009, 02:11:59 PM »
Deven,

If I have the following code replacement text

AA   F1   F2   F3
BB   F1      F3

(there are two tabs between F1 and F3 for BB)

The CR for AA works fine.  For BB, however, the fields are evaluated as follows:

Field1: F1
Field2: F3
Field3: --

Shouldn't be:

Field1: F1
Field2: --
Field3: F3

Having empty extended fields is not supported at this time.

-Kirk

Offline vAfotoriporter

  • Uber Member
  • ******
  • Posts: 1041
    • View Profile
    • Attila Volgyi photojournalist
Re: Code Replacement handling of missing fields
« Reply #2 on: April 07, 2009, 09:47:52 PM »
Howabout using space to fill in the gap? The field won't be empty but will seem to be for the naked eye and I think code replacement will consider it content so it will be replaced into the spot.
Working on Mac, OSX, iOS and with some Canons.
Allways shooting RAW.

http://www.volgyiattila.com

Offline devenh

  • Sr. Member
  • ****
  • Posts: 435
    • View Profile
Re: Code Replacement handling of missing fields
« Reply #3 on: April 07, 2009, 10:06:42 PM »
Sure, that is a workaround, but I think the better solution is for PM to be fixed.

Deven

Offline vAfotoriporter

  • Uber Member
  • ******
  • Posts: 1041
    • View Profile
    • Attila Volgyi photojournalist
Re: Code Replacement handling of missing fields
« Reply #4 on: April 07, 2009, 11:50:49 PM »
Sure, that is a workaround, but I think the better solution is for PM to be fixed.

Deven

That is true but up to Kirk and the developers.
Working on Mac, OSX, iOS and with some Canons.
Allways shooting RAW.

http://www.volgyiattila.com

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24730
    • View Profile
    • Camera Bits, Inc.
Re: Code Replacement handling of missing fields
« Reply #5 on: April 08, 2009, 12:27:32 AM »
Deven,

Sure, that is a workaround, but I think the better solution is for PM to be fixed.

I don't consider it broken.  I may allow extended replacements to be blank in the future.

-Kirk

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24730
    • View Profile
    • Camera Bits, Inc.
Re: Code Replacement handling of missing fields
« Reply #6 on: April 08, 2009, 12:45:38 PM »
Deven,

Sure, that is a workaround, but I think the better solution is for PM to be fixed.

I've changed the parsing to allow blank extended fields.  This means that the parsing is now more strict than before.  Now only one tab is allowed between the code and the first replacement (it used to allow as many as you wanted to use.)  And only one tab is allowed between extended replacements.  If there are two or more tabs between non-empty replacements they are treated as replacements that are empty.

The next update/beta will have this change in it.

-Kirk

Offline devenh

  • Sr. Member
  • ****
  • Posts: 435
    • View Profile
Re: Code Replacement handling of missing fields
« Reply #7 on: April 08, 2009, 01:22:37 PM »
Thank!

Offline vAfotoriporter

  • Uber Member
  • ******
  • Posts: 1041
    • View Profile
    • Attila Volgyi photojournalist
Re: Code Replacement handling of missing fields
« Reply #8 on: April 10, 2009, 03:04:33 AM »
Is it somewhere documented how to use extended code replacement syntax? I couldn't find it with the forum search engine.
Working on Mac, OSX, iOS and with some Canons.
Allways shooting RAW.

http://www.volgyiattila.com

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24730
    • View Profile
    • Camera Bits, Inc.
Re: Code Replacement handling of missing fields
« Reply #9 on: April 10, 2009, 07:09:07 AM »
Is it somewhere documented how to use extended code replacement syntax? I couldn't find it with the forum search engine.

\code\ will use the first replacement as usual
\code#1\ will also use the first replacement
\code#2\ will use the second replacement
\code#3\ will use the third replacement
etc.

HTH,

-Kirk