HELPLIB.HLB  —  RDML72  Statements  STORE Seg Strings, Examples  C Example
    #include <stdio.h>
    DATABASE PERS = FILENAME "PERSONNEL";

    main()
    {
    int line;
    char *document[3];

    document[0] = "first line of resume  ";
    document[1] = "second line of resume ";
    document[2] = "last line of resume   ";

    READY PERS;
    START_TRANSACTION READ_WRITE;

        STORE R IN RESUMES USING
            strcpy (R.EMPLOYEE_ID,"12345");
                             for (line = 0; line <= 2; line++)
                STORE LINE IN R.RESUME
                                     strcpy(LINE.VALUE,document[line]);
                    LINE.LENGTH = strlen(LINE.VALUE);
                END_STORE;
        END_STORE;

    FOR R IN RESUMES WITH R.EMPLOYEE_ID = "12345"
        FOR LINE IN R.RESUME
          printf("%s\n",LINE.VALUE);
        END_FOR;
    END_FOR;

    COMMIT;
    FINISH;
    }
Close Help