HP3000-L Archives

October 2001, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Donna Garverick <[log in to unmask]>
Reply To:
[log in to unmask][log in to unmask] 12589 100 47_Help: Build an XL containing C LDAP subroutines15_Richard [log in to unmask], 25 Oct 2001 14:46:18 -0600680_- Hello,

Any help would be appreciated.

I have tried the following:

gcc-2.95.2 -o ldapauth ldapauth.c -DMPE -D_SOCKET_SOURCE -D_MPEXL_SOURCE
-D_POSIX_SOURCE -I../include -L../lib -lldap -llber

This will build the file ldapauth as NMPRG as expected. What I really
need is an NMXL.

so, if change the comiple to

gcc-2.95.2 -c ldapauth.c -DMPE -D_SOCKET_SOURCE -D_MPEXL_SOURCE
-D_POSIX_SOURCE -I../include -L../lib -lldap -llber

I get the following warning - which are expected.
gcc-2.95.2: -lldap: linker input file unused since linking not done
gcc-2.95.2: -llber: linker input file unused since linking not done [...]38_25Oct200114:46:[log in to unmask]
Date:
Thu, 25 Oct 2001 12:55:04 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (77 lines)
Ron Wuerth wrote:

> Now, question...if I'm reading your scripts correctly,
> in your return variable (assuming there is a match)
> on the "search" script where you do the following:
>
>       setvar !_s_return_var "![_ma_rec!bin_return]"
>
> aren't you just putting a line like the following into
> the "_s_return_var"...
>
> "1     one"    #(no quotes)

yes, the whole record for the matched key is 'returned'

> I know you can play with things like "str" to pull out
> the "one" but I was under the impression you really
> wanted to input the key, and get ONLY the value
> back ready to go.

well, for my example, yes.  but for general purpose needs, the 'str' function
is needed.

> I bring this up because I finally got "smart" and did a
> "help functions" at the CI.  By doing that I rediscovered
> the "word" function.

(you do know the whole purpose of this exercise is to get everyone digging into
'help', right? :-)

> 1.  The obvious, you can now return JUST the value you're
>       looking for.

...and my original prototype (that never really saw the light of day) did just
that.

> 2.  If used correctly within your "mkarray" script, you can
>      accept data that is NOT ordered, misaligned, and no need
>      for even a binary search, because you have direct access
>      once the array is created.

hmmm....  that's right :-)

> to this:
> =========================
> 'mkarray'
> setvar _ma_eof finfo(HPSTDIN,"eof")
> while setvar(_ma_eof,_ma_eof-1) >= 0
>   input _ma_rec
>   setvar _ma_key word("!_ma_rec",,1)    # <=== is key only [added]
>   setvar _ma_val!_ma_key word("!_ma_rec",,2)  # <=== is value only
> endwhile
> ======================

assuming (and that's that dangerous thing :-) the data is word-able, then yes.

> We use the ACTUAL "key" numeral (the first data item
> in the rec) as the array index, (which makes it more like
> a hash).

yes....  what if the key isn't numeric?  i think we're still ok.....?

> Now to search for a specific value to use IF available,
> instead of the "binsrch" routine you have direct access
> as follows:

all-in-all -- you've made several excellent observations!          - d

--
Donna Garverick     Sr. System Programmer
925-210-6631        [log in to unmask]

>>>MY opinions, not Longs Drug Stores'<<<

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2