ReadFirstMain
Aldevinas Katkus
8-19-20
Operating system: macOS
I have found this in the source
if (ReadFirstMain(ORp,0,true)) then begin end;
What this code is supposed to do if we specify zero keys?
Is it some trick?
it is in RecordAction_rlOrderToPO()
Carolina Valentino
9-4-20
We are checking it, we ll contact you soon
David Delač
9-9-20
Hello Aldevinas,

You can usually use this to check if record consists of data or not.

Example:

procedure TestProcedure(record MailVc Mailr)
begin


if (ReadFirstMain(Mailr,0,true)==false) then begin
goto LTestProcedure;

end;

// do something

LTestProcedure:;
return;
end;

What this function does is that it receives MailVc as a parameter and then checks if there is some data in it. Since we are not trying to reload MailVc but rather just check if there is something in it, we use index '0'. This would return TRUE if there is some data and FALSE if MailVc is empty.

I hope this is clear, let me know if I can assist you with anything else.

Best Regards,
David D.
Swati D.
9-10-20
HI Aldevinas

please let me know if this has resolved the issue and we can close this job.

Thanks

Swati 2020.9.10
Swati D.
9-10-20
HI Aldevinas

please let me know if this has resolved the issue and we can close this job.

Thanks

Swati 2020.9.10
Christoffer Riska
9-17-20
The original question was regarding this code:

if (ReadFirstMain(ORp,0,true)) then begin end;

It is an if statement with an empty begin-end section.
Aldevinas Katkus
9-17-20
Created byChristoffer Riska07:39 17 Sep 2020
The original question was regarding this code: if (ReadFirstMain(ORp,0,true)) then begin end; It is an if statement with an empty begin-end section.
Original question was "What this code is supposed to do if we specify zero keys?" as it is in this case.
Swati D.
9-18-20
Hi Aldevinas

We will get back to you asap

Thank you for your patience


Swati 18.9
David Delač
9-18-20
Hi Aldevinas,

Like I explained in first reply, specifying zero keys is only used when checking if a record was already loaded or not. If record was loaded then ReadFirstMain returns true otherwise it returns false.

Usually when you are trying to load record from register, you would specify key value and number of keys/indexes in ReadFirstMain which is not the case in this example.

I hope that cleared it out.

Best regards,
David D.
Aldevinas Katkus
9-21-20
Created byDavid Delač21:52 18 Sep 2020
Hi Aldevinas, Like I explained in first reply, specifying zero keys is only used when checking if a record was already loaded or not. If record was loaded then ReadFirstMain returns true otherwise it returns false. Usually when you are trying to load re
Sorry, I somehow managed to miss your first answer. Everything is clear.
David Delač
9-21-20
Hi Aldevinas,

Thank you for your feedback.

Best regards,
David D.
Leave Comment
You can subscribe to notifications for this post by selecting the 'star' icon on the top right corner of the post.
Back to the list
Latest Posts
Afternoon, Some of our customers haven't changed their passwords for a while but they're not getting any password expiry message. If I copy their Standard ID into a new user on some test ...
17:22 25 Apr 2024
Andis Blicāns, Grasko
Hi, We have client using 8.5 2021-09-26 (build 85400383). The fields "Max Web Users" and "Max Sessions" ar blank. Server is closing itself almost every day. Message in hansa....
13:09 25 Apr 2024