How can I obtain the position of a character in the name of the current directory?


In ANSYS Release 11.0, the /INQUIRE and STRPOS() commands can be used to obtain the position of a character in the directory name. The INQUIRE command can be used to store the directory name in a string array. The STRPOS() command can be used to identify the position of a character in that string array.

/INQUIRE,pathname,directory ! stores directory name in a string array named 'pathname'
slashpos = STRPOS(pathname(1),'') ! stores location of the slash in parameter 'slashpos'

For example, if the current directory is c:, then the parameter 'slashpos' would be 3.0.





Show Form
No comments yet. Be the first to add a comment!