home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / Draw_Text_208177932007.psc / DrawTextTester / DrawText.bas < prev    next >
BASIC Source File  |  2007-09-03  |  19KB  |  454 lines

  1. Attribute VB_Name = "DrawTextMod"
  2. Option Explicit
  3. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  4. '   DrawText() DECLARATIONS
  5. '   ^^^^^^^^^^^^^^^^^^^^^^^
  6. '
  7. '
  8. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  9. Const TOTFONTS As Byte = 3 '''''''''''''''''''''''''''''' Total fonts available (0-TOTFONTS).
  10. Const MAXVECTORS As Integer = 5000 '''''''''''''''''''''' Maximum number of lines per font.
  11. Dim CharSet As String ''''''''''''''''''''''''''''''''''' The full characters set (94 characters).
  12. Dim FontFileNames(0 To TOTFONTS) As String '''''''''''''' Font file names.
  13. Dim VectorCount(TOTFONTS) As Integer '''''''''''''''''''' Number of vectors in each array.
  14. Dim VectorBounds(0 To TOTFONTS, 0 To 93, 0 To 1) As Integer 'Lower/Upper bounds of each character.
  15. Dim CarriageLocation As Single '''''''''''''''''''''''''' Next position for character.
  16. Dim CharNum As Integer '''''''''''''''''''''''''''''''''' Current character number.
  17. Dim X1, Y1, X2, Y2 As Single '''''''''''''''''''''''''''' Current vector being worked on.
  18. Dim Vectors(0 To TOTFONTS, 0 To MAXVECTORS, 0 To 3) As Single
  19. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  20. '
  21. '        Vectors(TOTFONT): Rec#  Col0  Col1  Col2  Col3
  22. '                          ----  ----  ----  ----  ----
  23. '                           1     X1    Y1    X2    Y2
  24. '                           2     X1    Y1    X2    Y2
  25. '                        ...n     X1    Y1    X2    Y2
  26. '
  27. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  28.  
  29. Sub DrawText(PicObj As Object, sdtParms() As Single, idtParms() As Integer, TextString As String)
  30.  
  31.     ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  32.     '   DrawText() FUNCTION - TEXT TO LINES PROCEDURE
  33.     '   '''''''''''''''''''''''''''''''''''''''''''''
  34.     '
  35.     '                Created: 08/28/2007
  36.     '           Last Updated: 09/02/2007
  37.     '      Programmed by: JAMES E. TRACY
  38.     '        Sacramento, California, USA
  39.     '          JamesTracy95820@gmail.com
  40.     '                    Copyright, 2007
  41.     '                    ^^^^^^^^^^^^^^^
  42.     '
  43.     '   DESCRIPTION
  44.     '   ^^^^^^^^^^^
  45.     '
  46.     '   Occasionally, the ability to draw text on a picture box using the LINE method
  47.     '   is needed, as it would allow complete control over a it's scale, location and
  48.     '   other factors.  This function accomplishes that by taking a string of characters
  49.     '   and drawing them as lines, using the LINE method.  Color, scale, rotation and
  50.     '   other factors can be completely controlled.
  51.     '
  52.     '   The function is scale independent, so it doesn't matter if you're using twips,
  53.     '   pixels, or any other measurement system.  The letters are one square unit in size,
  54.     '   by default.  If you are using pixels, that means each character is one square
  55.     '   pixel in size.  If scaled up by a factor of 20, then one character would fit within
  56.     '   exactly 20 pixels.  You can control the scaling on both the X and Y-axis.
  57.     '
  58.     '   There are currently three fonts available, but fonts can be designed fairly easily.
  59.     '   You can even design a font of your own handwriting.  If you'd like to design your
  60.     '   own font, just contact me at JamesTracy95820@gmail.com.
  61.     '
  62.     '   I wrote a little program that compiles the fonts from DXF files.  I used AutoCAD
  63.     '   release 14 to design the three fonts used by DrawText(), but any drawing program
  64.     '   capable of outputting DXF files in AutoCAD release 14 format would work fine.  I'd
  65.     '   be happy to accept new fonts!  The more the merrier.  Be sure to contact me first,
  66.     '   because there is an order to how the characters have to be arranged within a drawing
  67.     '   file.  As fonts are added, I'll either try to publish them somewhere, or you can
  68.     '   just email me and ask if any new ones have been added - I'll send you the updated
  69.     '   function if there are any.
  70.     '
  71.     '   ENJOY!
  72.     '
  73.     '   James Tracy
  74.     '   Sacramento , CA
  75.     '   JamesTracy95820@gmail.com
  76.     '
  77.     '   EXAMPLE USAGE
  78.     '   ^^^^^^^^^^^^^
  79.     '
  80.     '   Dim sdtParms(0 To 10) As Single
  81.     '   Dim idtParms(0 To 4) As Integer
  82.     '
  83.     '   Call the DrawTextInit() function.  Only call this once in your program!
  84.     '   This will call will automatically initialize your sdtParms and idtParms
  85.     '   variables to default values.
  86.     '
  87.     '   DrawTextInit sdtParms, idtParms '   Call only once in your program.
  88.                                         '   Or - you can call it again to re-initialize
  89.                                         '   your sdtParms and idtParms arrays to default
  90.                                         '   values.
  91.     '
  92.     '   Set variables: Short Draw Text Parameters
  93.     '
  94.     '   sdtParms(0) = 20#   '   X location of text.
  95.     '   sdtParms(1) = 280#  '   Y location of text.
  96.     '   sdtParms(2) = 20#   '   X scale of text.
  97.     '   sdtParms(3) = 20#   '   Y scale of text.
  98.     '   sdtParms(4) = 0#    '   Inidividual letter rotation.
  99.     '   sdtParms(5) = 0#    '   Text rotation.
  100.     '   sdtParms(6) = 1#    '   Character spacing.
  101.     '   sdtParms(7) = 1#    '   X overstrike amount (0=none)
  102.     '   sdtParms(8) = 0.1   '   X overstrike increment amount.
  103.     '   sdtParms(9) = 0#    '   Y overstrike amount (0=none)
  104.     '   sdtParms(10) = 0#   '   Y overstrike increment amount.
  105.     '
  106.     '   Set variables: Integer Draw Text Parameters
  107.     '
  108.     '   idtParms(0) = 255   '   RED color of text.
  109.     '   idtParms(1) = 0     '   GREEN color of text.
  110.     '   idtParms(2) = 0     '   BLUE color of text.
  111.     '   idtParms(3) = 0     '   FONT number:
  112.                             '       0   =   Courier
  113.                             '       1   =   JET, my own handwriting.
  114.                             '       2   =   AutoCAD TXT simple font.
  115.     ''''''''''''''''''''''''''''''''''
  116.     '   Do the DrawText() function   '
  117.     ''''''''''''''''''''''''''''''''''
  118.     '   DrawText Me.Picture1, sdtParms, idtParms, "AaBbGgJj 123 !@#$%^&*()_;<>,./?"
  119.     '
  120.     '   idtParms(0) = 0     '   RED color of text.
  121.     '   idtParms(1) = 255   '   GREEN color of text.
  122.     '   idtParms(2) = 0     '   BLUE color of text.
  123.     '   idtParms(3) = 0     '   FONT number
  124.     '   sdtParms(4) = 45#   '   Inidividual letter rotation.
  125.     '   sdtParms(5) = -45#  '   Text rotation.
  126.     '   DrawText Me.Picture1, sdtParms, idtParms, "Testing one two."
  127.     '
  128.     '   idtParms(0) = 0     '   RED color of text.
  129.     '   idtParms(1) = 0     '   GREEN color of text.
  130.     '   idtParms(2) = 255   '   BLUE color of text.
  131.     '   idtParms(3) = 1     '   FONT number
  132.     '   sdtParms(4) = -45#  '   Inidividual letter rotation.
  133.     '   sdtParms(5) = 45#   '   Text rotation.
  134.     '   DrawText Me.Picture1, sdtParms, idtParms, "~`!@#$%^&*()_-+={[}]"
  135.     '
  136.     '
  137.     ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  138.     '   FUNCTION PARAMETERS
  139.     '   ^^^^^^^^^^^^^^^^^^^
  140.     '
  141.     '   See EXAMPLE USAGE for all the array parameters.
  142.     '
  143.     ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  144.     Dim SingleChar As String
  145.     Dim L1 As Integer
  146.     'DumpArray sdtParms(), idtParms(), TextString
  147.     CarriageLocation = 0#
  148.     If Len(TextString) > 0 Then
  149.         For L1 = 1 To Len(TextString)
  150.             SingleChar = Mid(TextString, L1, 1)
  151.             CharNum = dtGetCharNum(SingleChar)
  152.             'm "Processing: " & SingleChar & "(" & Str(CharNum) & ")"
  153.             If CharNum = 255 Then
  154.                 MsgBox "Invalid character.  Program aborted", , "PROGRAM ABORTED"
  155.                 End
  156.             End If
  157.             If CharNum <> 94 Then       '   NOT a SPACE
  158.                 dtProcessChar PicObj, sdtParms, idtParms
  159.             Else
  160.                 dtIncrementCarriage sdtParms     '   We have a SPACE.
  161.             End If
  162.         Next L1
  163.     End If
  164. End Sub
  165. Sub DrawTextInit(sdtParms() As Single, idtParms() As Integer)
  166.     Dim Looper1 As Integer
  167.     Dim Looper2 As Integer
  168.     Dim Looper3 As Integer
  169.     FontFileNames(0) = "FONT_COURIER.txt"
  170.     FontFileNames(1) = "FONT_JET.txt"
  171.     FontFileNames(2) = "FONT_TXT.txt"
  172.     '
  173.     '
  174.     '
  175.     sdtParms(0) = 0#        '   X location for text.
  176.     sdtParms(1) = 0#        '   Y location for text.
  177.     sdtParms(2) = 1#        '   X scale.
  178.     sdtParms(3) = 1#        '   Y scale.
  179.     sdtParms(4) = 0#        '   Letter rotation.
  180.     sdtParms(5) = 0#        '   Text rotation.
  181.     sdtParms(6) = 1#        '   Character spacing.
  182.     sdtParms(7) = 0#        '   X overstrike amount.
  183.     sdtParms(8) = 0#        '   X overstrike increment amount.
  184.     sdtParms(9) = 0#        '   Y overstrike amount.
  185.     sdtParms(10) = 0#       '   Y overstrike increment amount.
  186.     '
  187.     idtParms(0) = 255       '   RED color.
  188.     idtParms(1) = 0         '   GREEN color.
  189.     idtParms(2) = 0         '   BLUE color.
  190.     idtParms(3) = 0         '   FONT number.
  191.     '
  192.     '   CHECK THAT FILES EXIST, AND INITIALIZE ARRAY
  193.     '
  194.     For Looper1 = 0 To TOTFONTS - 1
  195.         If Not FileExists(FontFileNames(Looper1)) Then
  196.             MsgBox "The file: " & FontFileNames(Looper1) & " does not exist.  Program aborted.", , "PROGRAM ABORTED"
  197.             End
  198.         Else
  199.             VectorCount(Looper1) = 0#
  200.             For Looper2 = 0 To MAXVECTORS - 1
  201.                 For Looper3 = 0 To 3
  202.                     Vectors(Looper1, Looper2, Looper3) = 0#
  203.                 Next Looper3
  204.             Next Looper2
  205.         End If
  206.     Next Looper1
  207.     For Looper1 = 0 To TOTFONTS - 1
  208.         For Looper2 = 0 To 93
  209.             VectorBounds(Looper1, Looper2, 0) = 32000       '   LOWER bound
  210.             VectorBounds(Looper1, Looper2, 1) = -32000      '   UPPER BOUND
  211.         Next Looper2
  212.     Next Looper1
  213.     CharSet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890~`!@#$%^&*()_-+={[}]|\:;" & Chr(34) & Chr(39) & "<,>.?/"
  214.     'm "CharSet length (space not in set)= " & Str(Len(CharSet))
  215.     If Len(CharSet) <> 94 Then
  216.         MsgBox "The character set does not contain exactly 94 characters.  Program aborted.", , "PROGRAM ABORTED"
  217.         End
  218.     End If
  219.     dtReadVectors
  220.     dtGetBounds
  221. End Sub
  222. Sub dtIncrementCarriage(sdtParms() As Single)
  223.     CarriageLocation = CarriageLocation + (sdtParms(6) * sdtParms(2))
  224. End Sub
  225. Sub dtDoOffset(sdtParms() As Single)
  226.     X1 = X1 + sdtParms(0)
  227.     Y1 = Y1 + sdtParms(1)
  228.     X2 = X2 + sdtParms(0)
  229.     Y2 = Y2 + sdtParms(1)
  230. End Sub
  231. Sub dtProcessCarriageLocation()
  232.     X1 = X1 + CarriageLocation
  233.     X2 = X2 + CarriageLocation
  234. End Sub
  235. Sub dtMoveHome()
  236.     X1 = X1 - CharNum
  237.     X2 = X2 - CharNum
  238. End Sub
  239. Sub dtScale(sdtParms() As Single)
  240.     X1 = X1 * sdtParms(2)
  241.     Y1 = Y1 * sdtParms(3)
  242.     X2 = X2 * sdtParms(2)
  243.     Y2 = Y2 * sdtParms(3)
  244.     
  245. End Sub
  246. Sub dtRotateLetters(sdtParms() As Single)
  247.     Dim X11 As Single
  248.     Dim Y11 As Single
  249.     sRotateZ sdtParms(4), X1, Y1, 0#, 0#, X11, Y11
  250.     X1 = X11
  251.     Y1 = Y11
  252.     sRotateZ sdtParms(4), X2, Y2, 0#, 0#, X11, Y11
  253.     X2 = X11
  254.     Y2 = Y11
  255. End Sub
  256. Sub dtRotateText(sdtParms() As Single)
  257.     Dim X11 As Single
  258.     Dim Y11 As Single
  259.     sRotateZ sdtParms(5), X1, Y1, sdtParms(0), sdtParms(1), X11, Y11
  260.     X1 = X11
  261.     Y1 = Y11
  262.     sRotateZ sdtParms(5), X2, Y2, sdtParms(0), sdtParms(1), X11, Y11
  263.     X2 = X11
  264.     Y2 = Y11
  265. End Sub
  266. Sub dtProcessChar(PicObj As Object, sdtParms() As Single, idtParms() As Integer)
  267.     Dim LowerBound As Integer
  268.     Dim UpperBound As Integer
  269.     Dim L1  As Integer
  270.     Dim OverStrikeLoop As Single
  271.     If CharNum < 0 Or CharNum > 93 Then
  272.         MsgBox "Character out of range error.  Program aborted!", , "PROGRAM ABORTED"
  273.         End
  274.     End If
  275.     LowerBound = VectorBounds(idtParms(3), CharNum, 0)
  276.     UpperBound = VectorBounds(idtParms(3), CharNum, 1)
  277.     'm "Bounds from " & Str(LowerBound) & " to " & Str(UpperBound)
  278.     For L1 = LowerBound To UpperBound
  279.         X1 = Vectors(idtParms(3), L1, 0)
  280.         Y1 = Vectors(idtParms(3), L1, 1)
  281.         X2 = Vectors(idtParms(3), L1, 2)
  282.         Y2 = Vectors(idtParms(3), L1, 3)
  283.         dtMoveHome
  284.         If sdtParms(4) <> 0# Then dtRotateLetters sdtParms
  285.         dtScale sdtParms
  286.         dtProcessCarriageLocation
  287.         dtDoOffset sdtParms
  288.         If sdtParms(5) <> 0# Then dtRotateText sdtParms
  289.         PicObj.Line (X1, Y1)-(X2, Y2), RGB(idtParms(0), idtParms(1), idtParms(2))
  290.         
  291.         
  292.         
  293.         If sdtParms(7) <> 0# Then       '   X overstrike.
  294.             If sdtParms(8) < sdtParms(7) Then
  295.                 For OverStrikeLoop = sdtParms(8) To sdtParms(7) Step sdtParms(8)
  296.                     PicObj.Line (X1 + OverStrikeLoop, Y1)-(X2 + OverStrikeLoop, Y2), RGB(idtParms(0), idtParms(1), idtParms(2))
  297.                 Next OverStrikeLoop
  298.             End If
  299.         End If
  300.         
  301.         If sdtParms(9) <> 0# Then       '   Y overstrike.
  302.             If sdtParms(10) < sdtParms(9) Then
  303.                 For OverStrikeLoop = sdtParms(10) To sdtParms(9) Step sdtParms(10)
  304.                     PicObj.Line (X1, Y1 + OverStrikeLoop)-(X2, Y2 + OverStrikeLoop), RGB(idtParms(0), idtParms(1), idtParms(2))
  305.                 Next OverStrikeLoop
  306.             End If
  307.         End If
  308.         
  309.         
  310.     Next L1
  311.     dtIncrementCarriage sdtParms
  312. End Sub
  313. Sub DumpArray(sdtParms() As Single, idtParms() As Integer, TextString As String)
  314.     Dim OutString As String
  315.     Dim L1, L2, L3, L4 As Integer
  316.     Dim Hand1 As Integer
  317.     Hand1 = FreeFile
  318.     Open "killme1.txt" For Output As #Hand1
  319.     Print #Hand1, "VECTOR COUNT"
  320.     Print #Hand1, "^^^^^^^^^^^^"
  321.     For L1 = 0 To TOTFONTS - 1
  322.         OutString = "Font: " & Str(L1) & " Vector count: " & Str(VectorCount(L1))
  323.         Print #Hand1, OutString
  324.     Next L1
  325.     Print #Hand1, ""
  326.     Print #Hand1, "FONT FILE NAMES"
  327.     Print #Hand1, "^^^^^^^^^^^^^^^"
  328.     For L1 = 0 To TOTFONTS - 1
  329.         Print #Hand1, "FontFileNames(" & Str(L1) & ")=" & FontFileNames(L1)
  330.     Next L1
  331.     Print #Hand1, "VECTOR BOUNDS"
  332.     Print #Hand1, "^^^^^^^^^^^^^"
  333.     For L1 = 0 To TOTFONTS - 1
  334.         For L2 = 0 To 93
  335.                 OutString = "Font: " & Str(L1) & " Char: " & Str(L2) & " Start: " & _
  336.                             Str(VectorBounds(L1, L2, 0))
  337.             Print #Hand1, OutString
  338.                 OutString = Space(18) & "Stop: " & Str(VectorBounds(L1, L2, 1))
  339.             Print #Hand1, OutString
  340.         Next L2
  341.     Next L1
  342.     Print #Hand1, "VECTORS"
  343.     Print #Hand1, "^^^^^^^"
  344.     For L1 = 0 To TOTFONTS - 1
  345.         Print #Hand1, "FONT # " & Str(L1) & ">--> " & FontFileNames(L1)
  346.         For L2 = 0 To 93
  347.             Print #Hand1, "    CHARACTER # " & Str(L2) & ">--> " & Mid(CharSet, L2 + 1, 1)
  348.             For L3 = VectorBounds(L1, L2, 0) To VectorBounds(L1, L2, 1)
  349.                 Print #Hand1, "        Font: " & Str(L1) & "|" & _
  350.                     Vectors(L1, L3, 0) & "|" & _
  351.                     Vectors(L1, L3, 1) & "|" & _
  352.                     Vectors(L1, L3, 2) & "|" & _
  353.                     Vectors(L1, L3, 3)
  354.             Next L3
  355.         Next L2
  356.     Next L1
  357.     '
  358.     '   PARAMETERS PASSED TO DrawText()
  359.     '
  360.     Print #Hand1, ""
  361.     Print #Hand1, "DrawText() Parameters"
  362.     Print #Hand1, "^^^^^^^^^^^^^^^^^^^^^"
  363.     Print #Hand1, ""
  364.     For L1 = 0 To 1
  365.         Print #Hand1, "sdtParms(" & Str(L1) & ")=" & Str(sdtParms(L1))
  366.     Next L1
  367.     Print #Hand1, ""
  368.     For L1 = 0 To 3
  369.         Print #Hand1, "idtParms(" & Str(L1) & ")=" & Str(idtParms(L1))
  370.     Next L1
  371.     Print #Hand1, ""
  372.     Print #Hand1, "TextString=" & TextString
  373.     Close #Hand1
  374. End Sub
  375. Sub dtGetBounds()
  376.     Dim L1, L2  As Integer
  377.     Dim CharNumber As Integer
  378.     For L1 = 0 To TOTFONTS - 1
  379.         For L2 = 0 To VectorCount(L1) - 1
  380.             CharNumber = Int(Vectors(L1, L2, 0))
  381.             VectorBounds(L1, CharNumber, 0) = iMin(L2, VectorBounds(L1, CharNumber, 0))  'LOWER bounds
  382.             VectorBounds(L1, CharNumber, 1) = iMax(L2, VectorBounds(L1, CharNumber, 1))  'UPPER bounds
  383.         Next L2
  384.     Next L1
  385.     '
  386.     '   Make sure there aren't any -1s in the array.
  387.     '   or less than zero, or greater than 93.
  388.     '
  389.     'For L1 = 0 To TOTFONTS - 1
  390.         'For L2 = 0 To 93
  391.             'm "Font # " & Str(L1) & " char: " & Str(L2) & " Starts: " & Str(VectorBounds(L1, L2, 0))
  392.             'm "Font # " & Str(L1) & " char: " & Str(L2) & " Stops:  " & Str(VectorBounds(L1, L2, 1))
  393.         'Next L2
  394.     'Next L1
  395. End Sub
  396. Sub dtReadVectors()
  397.     Dim InString As String
  398.     Dim Hand1 As Integer
  399.     Dim Hand2 As Integer
  400.     Dim Looper As Integer
  401.     Dim Fields() As String
  402.     For Looper = 0 To TOTFONTS - 1
  403.         Hand1 = FreeFile
  404.         Open FontFileNames(Looper) For Input As #Hand1
  405.         Do While Not EOF(Hand1)
  406.             Line Input #Hand1, InString
  407.             Fields = Split(InString, "|")
  408.             VectorCount(Looper) = VectorCount(Looper) + 1
  409.             If VectorCount(Looper) >= MAXVECTORS Then
  410.                 MsgBox "Maximum number of vectors has been exceeded.  Program aborted", , "ABNORMAL END"
  411.                 End
  412.             End If
  413.             Vectors(Looper, (VectorCount(Looper) - 1), 0) = CSng(Fields(0))
  414.             Vectors(Looper, (VectorCount(Looper) - 1), 1) = CSng(Fields(1))
  415.             Vectors(Looper, (VectorCount(Looper) - 1), 2) = CSng(Fields(2))
  416.             Vectors(Looper, (VectorCount(Looper) - 1), 3) = CSng(Fields(3))
  417.         Loop
  418.         Close #Hand1
  419.         'm "For font: " & FontFileNames(Looper) & " there are: " & Str(VectorCount(Looper))
  420.     Next Looper
  421. End Sub
  422. Function dtGetCharNum(CharIn As String) As Integer
  423.     Dim ReturnVal As Integer
  424.     Dim Loop1 As Integer
  425.     ReturnVal = 255  '   Invalid character!
  426.     If CharIn >= "a" And CharIn <= "z" Then
  427.         ReturnVal = Asc(CharIn) - 70 - 1
  428.     Else
  429.         If CharIn >= "A" And CharIn <= "Z" Then
  430.             ReturnVal = Asc(CharIn) - 64 - 1
  431.         Else
  432.             If CharIn >= "1" And CharIn <= "9" Then
  433.                 ReturnVal = Asc(CharIn) + 4 - 1
  434.             Else
  435.                 If CharIn = " " Then
  436.                     ReturnVal = 94
  437.                 Else
  438.                     For Loop1 = 62 To 94
  439.                         If CharIn = Mid(CharSet, Loop1, 1) Then
  440.                             ReturnVal = Loop1 - 1
  441.                         End If
  442.                     Next Loop1
  443.                 End If
  444.             End If
  445.         End If
  446.     End If
  447.     dtGetCharNum = ReturnVal
  448. End Function
  449.  
  450.  
  451.  
  452.  
  453.  
  454.