Title: | VAX DBMS |
Notice: | THIS NOTESFILE IS NOT A FORMAL SUPPORT CHANNEL |
Moderator: | SCARY::CHARLAND |
Created: | Thu Feb 20 1986 |
Last Modified: | Tue Jun 03 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 2642 |
Total number of notes: | 11044 |
Happy Valentine's Day. I have a customer who has a programming question. Since the only language I know is COBOL (shhhh! don't tell anyone), I'm stumped. He's using C and has implemented the DML COMPARE for an IF MEMBER test. However, he isn't getting the expected results. He used a pascal example from $ help DML DML_SYNTAX If_tests MEMBER Examples " The following example shows how the function MEMBER can be used (example written in PASCAL): IF (MEMBER (DBM$P_MANAGES) = DML$K_SUCCESS) THEN IF (COMPARE (DBM$TRUE) = DML$K_SUCCESS) THEN BEGIN . {statements} . END ELSE IF (COMPARE (DBM$FALSE) = DML$K_SUCCESS) THEN BEGIN . {statements} . END END" This looks incorrect to me. I'm not sure how the the dbm$false logic would ever get executed. The customer is also seeing the same results. When the record is a member, his code works correctly. When the record isn't a member, the code is executing as if the status code was an error condition and not end of collection. Any assistance would be greatly appreciated.
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
2595.1 | ORAREP::AUSS::GARSON | DECcharity Program Office | Mon Feb 17 1997 16:45 | 12 | |
re .0 It's been a long time since I wrote this stuff but the example would make sense if MEMBER returns success or failure depending on whether it could be executed and not depending on whether the current record is a member of the specified set. That interface might be more appropriate for a language using a DML preprocessor whereas a language with DML support built in could be more sophisticated. (It is my recollection that the argument to MEMBER is passed by reference which is going to cause a problem for unalert C programmers. Can you get a code fragment from the customer?) | |||||
2595.2 | M5::MGULLIKS | Marilyn I. Gulliksen - Worldwide Support | Tue Feb 18 1997 14:20 | 9 | |
It seems that the customer didn't tell me the whole story. He noticed the compare statement when he was looking in help for the if_member statement. None of his code is using the compare statement and things are working just fine. He called because he is worried that he should be using the compare statement. To the best of my knowledge, the compare statement isn't necessary. |