Operating System - OpenVMS
1751974 Members
4668 Online
108784 Solutions
New Discussion юеВ

Re: problem getting the correct filename

 
SOLVED
Go to solution
Karl Rohwedder
Honored Contributor

Re: problem getting the correct filename


$ IF filename .ne. ""
$ THEN
$! dicomFilename = p2 - F$PARSE(p2,,,"VERSION") - ".DCM" - F$PARSE(p1,,,"NAME")+ filename
$ dicomFilename = filename
$ ENDIF

Shouldn't that be ".nes." instead of ".ne."?
You are comparing strings.

regards Kalle
Lawrence Czlapinski
Trusted Contributor

Re: problem getting the correct filename

Uwe:
I didn't realize my original statement was ambiguous.
"If you use, ":=" whatever is behind it is interpeted as ASCII strings, so you would need single quotes around both parts to have DCL translate both parts correctly." typo corrected
First, single quotes are required for each symbol not the plus sign. Without the single quotes, DCL adds the characters to the string being defined. There are parsing exceptions including single quote and double quotes.
You didn't follow the whole example I gave.
$DICOMFILE:='DEV''DIR''FILENAME' !all Single quotes
There is no "+" sign.

When combining strings, you don't normally need a "+" sign.
ASDEV1├В┬╗ a="12"
ASDEV1├В┬╗ b="34"
ASDEV1├В┬╗ c:='a''b'
ASDEV1├В┬╗ sh sym c
C = "1234"

For
$dicomFilename:='F$PARSE(P2,,,"DIRECTORY")'+'FILENAME'
if you use ":=", you need single quotes for both parts, otherwise you only get the directory part. For this line you do need the "+" sign if you use ":=". This is probably because of the lexical translation.

ASDEV1├В┬╗ c:='a'+'b'
ASDEV1├В┬╗ sh sym c
C = "12+34"
ASDEV1├В┬╗ c:=a+b
ASDEV1├В┬╗ sh sym c
C = "A+B"
ASDEV1├В┬╗ c:='a+'b
ASDEV1├В┬╗ sh sym c
C = "12+34"
ASDEV1├В┬╗ c:=ab
ASDEV1├В┬╗ sh sym c
C = "AB"
Lawrence
Lawrence Czlapinski
Trusted Contributor

Re: problem getting the correct filename

nipun: Put the lexical parts of dicomfilename into symbols in your development debug version. Then you can have debug show symbol statements to show what DCL is getting for the parts and for dicomfilename. After you are satisfied, comment them out.
Lawrence
Uwe Zessin
Honored Contributor

Re: problem getting the correct filename

Yes, I got confused by this statement from you:
> Try dicomFilename:='F$PARSE(p2,,,"DIRECTORY")'+'filename'

Thanks for the correction.
.