home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / next / programm / 6033 < prev    next >
Encoding:
Text File  |  1992-09-08  |  2.7 KB  |  67 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!wupost!gumby!destroyer!ubc-cs!alberta!kakwa.ucs.ualberta.ca!raven!brad
  3. From: brad%raven@kakwa.ucs.ualberta.ca  (Brad Nelson)
  4. Subject: Re: Defaults Database management
  5. Message-ID: <1992Sep7.154405.15512@raven.uucp>
  6. Sender: brad@raven.uucp (Brad Nelson)
  7. References: <15314@umd5.umd.edu>
  8. Date: Mon, 7 Sep 1992 15:44:05 GMT
  9. Lines: 56
  10.  
  11. In article <15314@umd5.umd.edu> matthews@oberon.umd.edu (Mike Matthews)  
  12. writes:
  13. >I've looked through the Next Developer files in Librarian 
  14. >and have read the section on defaults, but I must be 
  15. >extremely dense because I still can't figure this one out. 
  16.  
  17. That makes two of us.
  18.  
  19. >How can I flush the registration table of defaults to the 
  20. >.NeXTdefaults database? NXWriteDefaultsVector() takes 
  21. >what's in your vector and dumps it to the database and 
  22. >puts the new values into the registration table. 
  23. >
  24. >I tried changing the vector information (a la strcpy) but 
  25. >that gave an "invalid operands to binary +" error on 
  26. >compile so there's something going on behind the scenes 
  27. >that I don't grok too well. 
  28.  
  29. I think that's because the vector is static - it's supposed
  30. to be the "default defaults".
  31.  
  32. [munch]
  33.  
  34. >It's gotta be simple. 
  35. >
  36. >Doesn't it? 
  37.  
  38. I must be dense too, I couldn't figure out a simple way to do
  39. that.  The thing that confused me was that I assumed that
  40. NXWriteDefaults() was simply a batched version of NXWriteDefault().
  41. Bzzzt!  The two functions don't do the same thing at all.  I can't
  42. imagine why NXWriteDefaults() even exists, given the way it works.
  43. (It writes the vector to disk, not the table)
  44.  
  45. The values in your NXDefaultsVector will always be available to your
  46. program as soon as you NXRegisterDefaults(), so why would you ever
  47. want to write the _vector_ to the defaults database?  Wouldn't it
  48. make more sense to have NXWriteDefaults() write the _table_ to the
  49. database rather than the vector?  Or, better yet, NXWriteDefaults()
  50. could go through the table and write only the values that are 
  51. different from the ones in the vector.
  52.  
  53. I guess the thing that confused me was that the docs say "To 
  54. maximize efficiency, you should use one call to NXWriteDefaults() 
  55. rather than several calls to NXWriteDefault() to write multiple values." 
  56. Sure, sure.  You use NXSetDefault() to update a value in the table,
  57. then you call NXWriteDefaults() to write the vector to the database
  58. and re-register, which overwrites the value you just NXSetDefault()ed
  59. with the one in the vector.  
  60.  
  61. Can anyone explain why this stuff works the way it does?  Is there
  62. an easy way to write the defaults in the _table_ out to the 
  63. database, rather than NXWriteDefault()-ing them individually?
  64.  
  65. -Brad        brad%raven@kakwa.ucs.ualberta.ca
  66.  
  67.