![]() |
| The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum. |
|
Post Reply
|
| Author | |
axys
Newbie
Joined: July 21 2004 Location: New Zealand Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Topic: check file exists - non-numeric resultPosted: 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: |
|
![]() |
|
CALIDORE
Beta Tester
Joined: May 10 2004 Location: United States Status: Offline Points: 139 |
Post Options
Thanks(0)
Quote Reply
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
|
|
![]() |
|
axys
Newbie
Joined: July 21 2004 Location: New Zealand Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
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. |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |