× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Pointer to a proc is very different from one that takes a data address. It is NOT what you want here.

Which Access API ? if you meant the C function then ...

D access PR 10I 0 ExtProc('access')
D Path * Value Options(*string)
D amode 10I 0 Value


Or

Dcl-Pr access Int(10) ExtProc('access');
path Pointer Value Options(*string);
amode Int(10) Value;
End-Pr;

Options(*string) avoids you having to null terminate the path name or even pass a pointer - just pass the string and RPG takes care of it.


Do yourself a favor and download Scott's IFS stuff http://scottklement.com/rpg/ifs.html <http://scottklement.com/rpg/ifs.html> the download includes headers (i.e. prototypes) for most if not all the C I/O functions. You could also download his CSVR4 library which also includes those and other headers. http://scottklement.com/csv/ <http://scottklement.com/csv/> Those headers also include all the constant definitions you are going to need.

There are loads of examples out on the web - I've written many myself. You can find my stuff at https://authory.com/JonParisAndSusanGantner <https://authory.com/JonParisAndSusanGantner> search for IFS


jon Paris


On Jun 9, 2021, at 4:07 PM, SReeves@xxxxxxxxxxxxxxxxxx wrote:

Does anyone have an example out there of defining/using the Access API in
full free RPG?

I see a couple examples on the internet using fixed format. It appears to
use a pointer which is where I think I'm having issues as I don't normally
use them.
I'm declaring the pointer as
Dcl-s ptr POINTER(*PROC);

However, I get compile errors that the left/right don't match when I try
to populate it.
ptr = %Addr(Pathname);


Shane Reeves

--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.