Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing values by descriptor to UDFs [CORE586] #942

Closed
firebird-automations opened this issue Jul 31, 2001 · 3 comments
Closed

Passing values by descriptor to UDFs [CORE586] #942

firebird-automations opened this issue Jul 31, 2001 · 3 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Sean Leyne (seanleyne)

Assigned to: Claudio Valderrama C. (robocop)

SFID: 446208#⁠
Submitted By: seanleyne

It is sometimes necessary to determine whether a
values passed to a UDF is NULL. The current approach
which passes parameters by value prohibits this test --
a NULL is passed as an empty value, which can't be
distinguish from a 'real' empty/zero value.

@firebird-automations
Copy link
Collaborator Author

Commented by: Alice F. Bird (firebirds)

Date: 2001-07-31 07:08
Sender: seanleyne
Logged In: YES
user_id=71163

From Claudio: I implemented DESCRIPTORS as UDF parameters.
The verb "implement" is misleading there: I only uncovered
the feature previously available only to GDML definitions
and added DESCRIPTORS as a return mechanism. This small
addition is only for writing UDFs in a slightly
simpler way (IMHO, of course), it doesn't mean you can
change the type of the return parameter as set in the UDF
declaration (or definition).

The reason I couldn't change normal BY REFERENCE parameters
to be the null pointer (or nil) when the parameter is NULL
is because there are a lot of UDFs written already and they
don't expect a null pointer but zero or empty string, so I
would have broken all of them. But when working with
descriptors, the engine already passed a null pointer to
signal NULL, before I touched it.

In fact, the [almost silently] posted FBUDF relies on
descriptors and seems to work well. I intended it to be
pushed into a subdir of the extlib one but since the WinCVS
client is not very intuitive and inconsistent (but better
than nothing or having to remember 10 command-line params
for me), the files appeared in the same extlib directory.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 10610 ] => Firebird [ 14949 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant