Highlighted
Absent Member.
Absent Member.
583 views

[archive] R$io/i$io

[Migrated content. Thread originally posted on 03 December 2007]

I'm trying to improve our inhouse toolkits, and am currently writing a hexdump style record viewer using R$IO and I$IO. I'm having a problem with each and was hoping someone here would be able to point out what I need to do differently.

R$IO: I haven't seen any sample code for this, but assume it works like I$IO. I've read the 7.2 documentation for this call, and set things up like it looks they need to be. I can get a successful open, but when I call it for the START_FUNCTION it crashes on me. Is there something different I need to be doing to start this other than:
77 KEY-VAL SIGNED-LONG.
...
*
SET IO-START-FUNCTION TO TRUE.
SET IO-F-NOT-LESS TO TRUE.
MOVE START-KEY TO KEY-VAL CONVERT.
CALL "R$IO" USING IO-FUNCTION, FILE-HANDLE, KEY-VAL, IO-START-MODE.

I$IO: This works like a champ except for one (seemingly minor) issue. On files with alternate keys, it returns back the correct number of keys when I query for file information. However, when I attempt to start the file it only ever recognizes the primary key. No matter which keynum I pass I$IO it _always_ uses the primary key as the key of reference. Is this a bug or am I doing something wrong?


Any assistance on these two issues would be appreciated!
0 Likes
7 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] R$io/i$io

You may want to look at the definitions in filesys.def. I think the correct function for r$io is R-OPEN-FUNCTION
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] R$io/i$io

You may want to look at the definitions in filesys.def. I think the correct function for r$io is R-OPEN-FUNCTION


Thanks for the response! I had checked that out earlier and the documentation had both I-OPEN-FUNCTION and R-OPEN-FUNCTION defined as the same value, so I had I-OPEN-FUNCTION in both places to try and condense my logic down as much as possible. The open returns successfully, it's the read using r$io that's crashing the runtime.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] R$io/i$io

Sounds like a runtime error. I would report it to Technical support.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] R$io/i$io

Sounds like a runtime error. I would report it to Technical support.


D'oh, that's what I was afraid of. Thanks for the help!
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] R$io/i$io

I created a simple program that allows you to put in one record into a relative file. Then use the push button on the screen to call R$IO. The file get opened.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] R$io/i$io

I created a simple program that allows you to put in one record into a relative file. Then use the push button on the screen to call R$IO. The file get opened.


Yeah I can get the file opened just fine with R$IO, but the runtime was crashing when I passed the returned file handle to R$IO to start it for a read. I just went back over the documentation and this looks like it was user error all along. I misread the documentation when trying to condense my code down. R-START-FUNCTION is defined as 7, I-START-FUNCTION is 8, so I was trying to do a write instead of a start. Boy don't I feel dumb! I'm still having the same issue with trying to use an alternate key with I$IO however.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] R$io/i$io

Although it may not be very helpful I believe the source to Alfred uses I$IO and it is able to access files based on alternate keys.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.