Author Topic: Code Replacement Questions  (Read 7302 times)

Offline IanGoldstein

  • Member
  • **
  • Posts: 98
    • View Profile
Code Replacement Questions
« on: June 20, 2007, 06:40:41 PM »
I just have a few quick questions regarding the code replacment feature...

(1) I'm assuming blank lines are allowed in code replacement files, since they seemed to be skipped. Is this correct?
(2) Are multiple tabs allowed in code replacement files? They currently seem to be okay and allow for clean column layouts in the files.
(3) Is there support for comments in the code replacement files?
(4) Do the {byline} and {photog} variables refer to the same data?
(5) Similarly, are the {state} and {province} the same data field?

Thanks,
Ian
« Last Edit: June 20, 2007, 06:42:22 PM by IanGoldstein »

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Code Replacement Questions
« Reply #1 on: June 20, 2007, 11:18:46 PM »
Ian,

I just have a few quick questions regarding the code replacment feature...

(1) I'm assuming blank lines are allowed in code replacement files, since they seemed to be skipped. Is this correct?

Yes.

Quote from: IanGoldstein
(2) Are multiple tabs allowed in code replacement files? They currently seem to be okay and allow for clean column layouts in the files.

Yes.

Quote from: IanGoldstein
(3) Is there support for comments in the code replacement files?

No.

Quote from: IanGoldstein
(4) Do the {byline} and {photog} variables refer to the same data?

Yes.

Quote from: IanGoldstein
(5) Similarly, are the {state} and {province} the same data field?

Yes.

-Kirk

Offline IanGoldstein

  • Member
  • **
  • Posts: 98
    • View Profile
Re: Code Replacement Questions
« Reply #2 on: June 21, 2007, 07:21:01 AM »
(3) Is there support for comments in the code replacement files?

No.

Kirk,

If duplicate codes are entered, it appears the last one takes precedence. Based on this, it looks like we could add comments by using a specific "code" as a prefix for all comment lines. Obviously, it must be a code not likely to be needed as an actual replacement code. Codes such as "Note:", "Comment:" or "NB." would seem to work well for this. I also tried this using more traditional comment characters, such as "#",  ";" and "//" and they seems to work fine as well. (Which is good, because "//" is what I would use.)

Interestingly, it also appears that after the replacement text, a tab character and any following text is ignored. If this is by design, then even in-line comments could be used, as long as they were separated from the replacement text by at least one tab.

Do you see any problems with any of this?

Thanks,
Ian



Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Code Replacement Questions
« Reply #3 on: June 21, 2007, 07:25:45 AM »
Ian,

(3) Is there support for comments in the code replacement files?

No.

If duplicate codes are entered, it appears the last one takes precedence. Based on this, it looks like we could add comments by using a specific "code" as a prefix for all comment lines. Obviously, it must be a code not likely to be needed as an actual replacement code. Codes such as "Note:", "Comment:" or "NB." would seem to work well for this. I also tried this using more traditional comment characters, such as "#",  ";" and "//" and they seems to work fine as well. (Which is good, because "//" is what I would use.)

Interestingly, it also appears that after the replacement text, a tab character and any following text is ignored. If this is by design, then even in-line comments could be used, as long as they were separated from the replacement text by at least one tab.

Do you see any problems with any of this?

No, all of what you suggested would indeed work.

-Kirk