[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: FourthWorld, heatherlaine, Klaus, 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 » Fri Jul 20, 2018 10:08 pm

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 » Sat Jul 21, 2018 7:14 pm

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 » Mon Jul 23, 2018 3:04 pm

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

Working on it.

Mike

Post Reply

Return to “Talking LiveCode”