Sushant Pradhan
New Member
Hello,
I am working on webspeed and I need help on command 'input from" when its used alongwith value(expression).
Eg.
define variable filepath as character no-undo.
define variable usrdata as character no-undo.
filepath = "C:\user1\user1.txt".
input from value(filepath).
import unformatted usrdata.
input close.
display usrdata.
Now, if ONLY user1 directory is present alongwith user1.txt file, AND NO OTHER DIRECTORY EXISTS FOR ANY OTHER USER. In this case, there will be no errors and the data in the user1.txt file will be displayed on the screen.
My problem arises here, when the user1 is replaced in the code is replaced with user2, then the error issued is "Cannot find the file C:\user2\user2.txt".
This replacement is dynamic as the user1 is acutally a variable in my code, and depends upon which user has logged in.
Is there any way by which a condition can be introduced to check whether the path assigned to the variable 'filepath' is valid or not. If this path is valid then no probs, the contents should be displayed, but if this path is invalid, then I want this error to be avoided and a blank page should be displayed.
Please advise me on this ... asap.
Regards,
Sushant.
I am working on webspeed and I need help on command 'input from" when its used alongwith value(expression).
Eg.
define variable filepath as character no-undo.
define variable usrdata as character no-undo.
filepath = "C:\user1\user1.txt".
input from value(filepath).
import unformatted usrdata.
input close.
display usrdata.
Now, if ONLY user1 directory is present alongwith user1.txt file, AND NO OTHER DIRECTORY EXISTS FOR ANY OTHER USER. In this case, there will be no errors and the data in the user1.txt file will be displayed on the screen.
My problem arises here, when the user1 is replaced in the code is replaced with user2, then the error issued is "Cannot find the file C:\user2\user2.txt".
This replacement is dynamic as the user1 is acutally a variable in my code, and depends upon which user has logged in.
Is there any way by which a condition can be introduced to check whether the path assigned to the variable 'filepath' is valid or not. If this path is valid then no probs, the contents should be displayed, but if this path is invalid, then I want this error to be avoided and a blank page should be displayed.
Please advise me on this ... asap.
Regards,
Sushant.