Rocket Software Homepage
Forum Home Forum Home > AccuTerm Knowledge Base (read only) > Code Samples
  New Posts New Posts RSS Feed - check file exists - non-numeric result
  FAQ FAQ  Forum Search   Register Register  Login Login

The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum.

Forum Lockedcheck file exists - non-numeric result

 Post Reply Post Reply
Author
Message
axys View Drop Down
Newbie
Newbie


Joined: July 21 2004
Location: New Zealand
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote axys Quote  Post ReplyReply Direct Link To This Post Topic: check file exists - non-numeric result
    Posted: June 26 2006 at 2:01pm
Hi
I am using some sample code to check if a local PC file exists but I am getting a non-numeric value returned.

I haven't managed to capture the non-numeric data but list-runtime-errors has reported the error.

Can anyone suggest what I can do to ensure that only numeric (and correct) results are returned from the following code.

SCR='On Error Resume Next'
SCR=SCR:CHAR(25):'X = 0'
SCR=SCR:CHAR(25):'X = Abs(FileExists("':PATH:'"))'
SCR=SCR:CHAR(25):'InitSession.Output Cstr(X) & Chr$(13)'
PRINT CHAR(27):CHAR(2):'P':SCR:CHAR(13):
ECHO OFF
PROMPT ''
INPUT STATUS:



Back to Top
CALIDORE View Drop Down
Beta Tester
Beta Tester


Joined: May 10 2004
Location: United States
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote CALIDORE Quote  Post ReplyReply Direct Link To This Post Posted: June 26 2006 at 7:02pm

Hi axys

The FileExists routine returns a literal of either 'True' or 'False', you need to remove the abs() function from the script.
KMW
Back to Top
axys View Drop Down
Newbie
Newbie


Joined: July 21 2004
Location: New Zealand
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote axys Quote  Post ReplyReply Direct Link To This Post Posted: June 26 2006 at 7:44pm
Thanks

I can't remember exactly where I got this code from but I found similar examples in FTBP eg. FTWIZ

CALL FTPGMDIR(PATH) ;* NEED PATH TO LAUNCH EDITOR PROGRAM
PRINT ESC:STX:'PInitSession.Output CStr(Abs(FileExists("':PATH:FTWIZPGM:'"))) & Chr$(13)':CR:
ECHO OFF; PROMPT ''
INPUT ANS:

but I will give it a test without the Abs() function. My knowledge of VB is very limited.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.