I am new to progress development. I need to parse a UNC path from field data which was concantenated using commas(",") as delimiters. No matter what i do i cannot seem to get the variable "PosA" to return the position of the first comma. Here is what I thought would work:
DEF VAR ClientFilePath AS CHAR no-undo.
DEF VAR PosA AS INT no-undo.
FIND SysAgent WHERE SysAgent.FileRootDir <> "" No-Lock No-Error.
ClientFilePath = SysAgent.FileRootDir.
PosA = LOOKUP(ClientFilePath, ",").
ClientFilePath = SUBSTRING(ClientFilePath,1,PosA-1).
NOTE: The contents of the field "SysAgent.FileRootDir" are "//server/folder1,c:/folder2,//server/folder2"
NOTE: I changed the backslashes to forwardslashes because the forum editor wanted to see them as paths.
NOTE: I am trying to pull the first path from the field.
NOTE: I also thought I could put the LOOKUP inside the SUBSTRING but it is easier to read as it is.
PosA always returns 0.
Why doesn't this work? Is there a better (working) way?
Thanx in advance!
DEF VAR ClientFilePath AS CHAR no-undo.
DEF VAR PosA AS INT no-undo.
FIND SysAgent WHERE SysAgent.FileRootDir <> "" No-Lock No-Error.
ClientFilePath = SysAgent.FileRootDir.
PosA = LOOKUP(ClientFilePath, ",").
ClientFilePath = SUBSTRING(ClientFilePath,1,PosA-1).
NOTE: The contents of the field "SysAgent.FileRootDir" are "//server/folder1,c:/folder2,//server/folder2"
NOTE: I changed the backslashes to forwardslashes because the forum editor wanted to see them as paths.
NOTE: I am trying to pull the first path from the field.
NOTE: I also thought I could put the LOOKUP inside the SUBSTRING but it is easier to read as it is.
PosA always returns 0.
Why doesn't this work? Is there a better (working) way?
Thanx in advance!