#1 2011-03-29 09:57

jmorris376
Member
Registered: 2011-03-29
Posts: 1

Serialize in pairs?

I am new to the program, and am in general a novice at scripting. I believe it is an excellent software.

I would like to serialize a batch of pictures, but have it repeat each integer twice (eg. 1,1,2,2,3,3...etc.).  Is this possible?

My general scenario is this:  I would like to have a picture slideshow of trivia questions where the first question slide (name.a.jpg) needs to be closely proceeded by the second answer slide (name.b.jpg).  The problem occurs because I have about 6 folders of trivia slides, each with different categories that I would like to shuffle together.  What I want to avoid is having all the question slides in a combined series proceeded by all the answer slides in a combined series for each round of questions.  I want to have category 1:question, answer, category 2: question, answer...etc.

Maybe my solution above won't help, I can't fully wrap my mind around how to accomplish this.  Any thoughts?

Offline

#2 2011-03-29 12:48

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,480

Re: Serialize in pairs?

Serializing with every index repeated twice is possible and the script below will do exactly that.

var
  Index: Integer;
  Flag: Boolean;
begin
  if not Flag then
    Index := Index + 1;
  Flag := not Flag;
  FileName := IntToStr(Index) + ' ' + FileName;
end.

It is not very clear to me what exact pattern of files you are trying to achieve. Can you add few examples?

For example, original structure:

Category A \ Question 1
Category A \ Answer 1
Category A \ Question 2
Category A \ Answer 2
Category B \ Question 1
Category B \ Answer 1
Category B \ Question 2
Category B \ Answer 2

Desired structure:

1 - Question 1 from Category A
1 - Answer 1 from Category A
2 - Question 2 from Category A
2 - Answer 2 from Category A
3 - Question 1 from Category B
3 - Answer 1 from Category B
4 - Question 2 from Category B
4 - Answer 2 from Category B

Online

#3 2011-03-29 12:50

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Serialize in pairs?

Hi Jim, welcome!

Can you provide a few before/after examples please?

Like

Before:
Folder One\
Folder One\File A
Folder One\File B

Folder Two\
Folder Two\File A
Folder Two\File B

After it should look like this:
...
...
...


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

Board footer

Powered by FluxBB