Skip to content

implement ISMEMOFETCHED() function (partial)#1931

Merged
RobertvanderHulst merged 3 commits into
devfrom
feature/ismemofetched
May 15, 2026
Merged

implement ISMEMOFETCHED() function (partial)#1931
RobertvanderHulst merged 3 commits into
devfrom
feature/ismemofetched

Conversation

@Irwin1985
Copy link
Copy Markdown
Contributor

Checks memo field fetch status. For local data (DBF), memo is always fetched.
Marked Partial. Full support require remote views or cursor adapters.

@RobertvanderHulst
Copy link
Copy Markdown
Member

I think the check for BOF() ,or.. EOF() is wrong.
For a table with records and no index, skipping -1 after a Go Top will set BOF() but the cursor is on record 1.
I think the check should be for EOF() only.

@Irwin1985
Copy link
Copy Markdown
Contributor Author

I think the check for BOF() ,or.. EOF() is wrong. For a table with records and no index, skipping -1 after a Go Top will set BOF() but the cursor is on record 1. I think the check should be for EOF() only.

I was reading the docs and it states:

"The null value (.NULL.) is returned for a cursor if the record pointer is positioned at the beginning or end of the cursor."

And right after that it adds:

"Use the BOF() Function and the EOF() Function to determine if the record pointer is positioned at the beginning or end of the cursor."

So I'll keep both BOF() and EOF() for this check.

@cpyrgas
Copy link
Copy Markdown

cpyrgas commented May 14, 2026

Irwin, as we have found out the hard way, docs are often very unreliable and the real behavior can often be very different. Why don't you just check what VFP does exactly with a small sample to be sure?

@Irwin1985
Copy link
Copy Markdown
Contributor Author

Hi @cpyrgas,

Good point, let's see the real behavior from VFP. I've executed the following example in VFP9:

CLEAR
CREATE CURSOR TestCursor (custId I, notes M)
INSERT INTO TestCursor VALUES (1, "test memo")

GO TOP
?ISMEMOFETCHED("notes") && .T.
?ISMEMOFETCHED(2) && .T.

GO TOP
SKIP -1 && BOF
?ISMEMOFETCHED("notes") && .NULL.

GO BOTTOM
SKIP && EOF
?ISMEMOFETCHED("notes") && .NULL.

According to docs, the behavior is the same. The function is now set as Partial, when we have remote views or cursor adapters in the pocket then I'll add the corresponding implementation for that edge case too.

Thanks for the suggestion.

@RobertvanderHulst RobertvanderHulst merged commit bb1d38f into dev May 15, 2026
1 check passed
@RobertvanderHulst RobertvanderHulst deleted the feature/ismemofetched branch May 15, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants