home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code2 / tag_env / read.txt next >
Text File  |  1992-09-24  |  2KB  |  67 lines

  1.  
  2.  
  3. '   Tag Environment subsystem:
  4. '
  5. '   Contributed by:
  6. '   Tom Dacon, 71062,426
  7. '   Dacon Software Consulting
  8. '   3924 Park Place #3
  9. '   Montrose, CA 91020
  10. '
  11. '   Free.  Public domain.
  12. '
  13. '   This posting contains
  14. '       read.me          - this ASCII file
  15. '       tagenv.bas       - implements the functionality
  16. '       strtok.bas       - required support routine
  17. '       tagenv.mak, etc. - testbed VB project illustrating usage
  18. '
  19. '
  20. '   This set of routines provides support for tagged string fields
  21. '   in a VB Form or Control Tag property.
  22. '
  23. '   The Tag property, under this support, consists of a string
  24. '   of keyword=value pairs, delimited by semicolons;  for instance,
  25. '   the following might be a tag string:
  26. '
  27. '   formname=myForm;MyName=Tom Dacon;My Full Name=Thomas A. Dacon
  28. '
  29. '   You delete a string from a tagged string field by setting it
  30. '   to a null string, just like the SET command in DOS.
  31. '
  32. '   Keywords and contents fields are stored in mixed case, as supplied,
  33. '   but searches for keywords are case-insensitive.
  34.  
  35.  
  36. '   The Application Programmer's Interface (API):
  37. '
  38. '   SetFormTagString form,    key$, contents$
  39. '   GetFormTagString form,    key$, contents$
  40. '
  41. '   SetCtlTagString  control, key$, contents$
  42. '   GetCtlTagString  control, key$, contents$
  43.  
  44. '
  45. '   Unfortunately, there have to be different routines for Forms and
  46. '   Controls, since they are represented as different data types; if
  47. '   I'd written this as a DLL I suppose I could have handled the problem
  48. '   but I didn't know how to write custom controls then.
  49. '
  50. '   Imbedded blanks are OK in both the key and value fields; leading
  51. '   and trailing blanks are removed before storing the strings, so of
  52. '   course they do not appear when the string is retrieved.
  53.  
  54. '   The delimiter between key and value pairs is the semicolon; so you
  55. '   have to guard yourself against using a key or value string that itself
  56. '   contains a semicolon. Or change the delimiter. Or write a better
  57. '   parser (copy me if you do).
  58. '
  59. '   Double quotes around the value string are stored in the Tag property,
  60. '   but stripped before the string is returned to the caller of Get...().
  61. '   I don't remember now why I put this in, but there it is;  what's a
  62. '   mother to do?
  63.  
  64. '   The StrTok$() function used herein is the same one I've posted
  65. '   separately, for someone who needed to parse simple strings.
  66.  
  67.