Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: Passing variables into Filelen Function
Topic Summary:
Created On: 01/23/2014 04:12 AM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
 01/23/2014 04:12 AM
User is offline View Users Profile Print this message

Author Icon
AlanRodgers
n00b (>6 posts)

Posts: 2
Joined: 01/23/2014

Can anyone advise as to how I would pass variables into the file path on a Filelen statement?

The location variable string works fine when simply opening a file, and the Filelen statement runs fine when using the absolute file location, but when I put the variables into the Filelen I get

Syntax Error: Expecting ')"' at script line 2

Expression as follows:

Filelen("\\drive\%monthyear%\Database%filedate%.mdb")

Where %monthyear% is today's date formatted as mmmyy and %filedate% is today's date formatted as mmdd.

Any help apprecuiated.



 Category Survey
 01/23/2014 08:54 AM
User is offline View Users Profile Print this message

Author Icon
JeanDelfosse
Supreme Guru (1000+)

Posts: 8883
Joined: 03/30/2005

Alan,
could you try
Filelen("\\drive\" & monthyear & "\Database" & filedate & ".mdb")
?
The error you've got comes from using %'s inside a basic script expression

The syntax you used could work as
variable fn equaling "\\drive\%monthyear%\Database%filedate%.mdb"
Filelen(fn)



 Category Survey
AutoMate 8 version:
Windows version:


-------------------------
Jean Delfosse - Automate Beta Tester
Win7 Pro 64 bits -Win XP Pro SP3 32 bits - AM8, AM7, BPA10, BPA9, BPA8, BPA7, AM6 Enterprise, AM4
 01/24/2014 01:07 AM
User is offline View Users Profile Print this message

Author Icon
AlanRodgers
n00b (>6 posts)

Posts: 2
Joined: 01/23/2014

Brilliant! Thanks, Jean, you've been a great help.



 Category Survey
 01/24/2014 04:03 AM
User is offline View Users Profile Print this message

Author Icon
JeanDelfosse
Supreme Guru (1000+)

Posts: 8883
Joined: 03/30/2005

You're welcome, Alan

 Category Survey
AutoMate 8 version:
Windows version:


-------------------------
Jean Delfosse - Automate Beta Tester
Win7 Pro 64 bits -Win XP Pro SP3 32 bits - AM8, AM7, BPA10, BPA9, BPA8, BPA7, AM6 Enterprise, AM4
Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 1881 guests browsing this forum, which makes a total of 1881 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2020 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog