[SOLVED] Adding a number to a file - should be simple,eh?

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
karmacomposer
Posts: 361
Joined: Wed Apr 27, 2011 2:12 pm

[SOLVED] Adding a number to a file - should be simple,eh?

Post by karmacomposer »

Finally figured out how to append a number to the file path.

Here's the code:

Code: Select all

global varLastBlock
      put "/PDAForm" & varLastBlock & ".pdf" into tFirstPath
      replace return with empty in tPDFpath
      put specialFolderPath("documents") & tFirstPath into tPDFPath
Thank goodness.

Mike
capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: [SOLVED] Adding a number to a file - should be simple,eh?

Post by capellan »

Hi Mike,

You could add the time to a name too. In this way, your users could not
overwrite any file by mistake:

Code: Select all

put "/PDAForm" & varLastBlock && the ticks & ".pdf" into tFirstPath
http://livecode.wikia.com/wiki/Ticks

Al
karmacomposer
Posts: 361
Joined: Wed Apr 27, 2011 2:12 pm

Re: [SOLVED] Adding a number to a file - should be simple,eh?

Post by karmacomposer »

I can't do that - have to be serialized for saving and loading.

Working on it.

Mike
Post Reply