Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check if LINK-block exists #17

Open
pstahlhofen opened this issue Dec 21, 2021 · 3 comments
Open

check if LINK-block exists #17

pstahlhofen opened this issue Dec 21, 2021 · 3 comments

Comments

@pstahlhofen
Copy link

Is it possible to check in a multi-block JCAMP-file, if there is any block with DATA_TYPE=LINK and to adjust the behaviour of the splitMultiblockDX-function accordingly? I experienced that in cases where the LINK-block is missing, the function will now simply throw an error because it thinks that the number of START and END statements do not match. I viewed the code and found out that this is due to the implicit assumption that there must always be a LINK-block. In my example, however, there was no such block, so I added it manually.

@bryanhanson
Copy link
Owner

I'll look into this in January. JCAMP allows a lot of different configurations which creates a lot of possibilities. Adding what was missing manually was a good idea, I've had to do that a lot of times (not for the LINK, but for required parameters that vendors leave out).

@pstahlhofen
Copy link
Author

Alright, thank you!

@bryanhanson
Copy link
Owner

##DATA TYPE= LINK
##BLOCKS=some_integer

The above is what the JCAMP standard requires, but the function only checks for ##BLOCKS= so I guess the file that is giving you trouble is missing ##BLOCKS=. But, is it also missing ##DATA TYPE= LINK line?

I think the fix is to issue a warning if ##BLOCKS= is missing, but then we'll still have to find an equal number of TITLE and END statements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants