ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¦p¦ó¨Ï¥Î°}¦C¤ñ¹ï¥æ¶°ªºµ{¦¡½X?

[µo°Ý] ¦p¦ó¨Ï¥Î°}¦C¤ñ¹ï¥æ¶°ªºµ{¦¡½X?

¤£¦n·N«ä,¤S¨Ó¦V¦U¦ì¤j¤j½Ð±Ð
·Q½Ð±Ðªº°ÝÃD¬O(¦p¦ó±N¨â­Ó°}¦C¤ñ¹ï,Åã¥Ü¥X¦³¥æ¶°ªº¸ê®Æ
¨Ò¦pA¡BB °}¦C³£¬O ¬Û¦P¤j¤p
dim aa : redim aa(1 to 2,1 to 2)
dim bb: redim bb(1 to 2,1 to 2)
¦ýaa(1,1)=true :aa(1,2)=true
¦Óbb(1,1)=true

¦]¦¹¥u¦³(1,1)³o­Ó°}¦C¦ì¸m¬O¬Û¦P³£¬Otrue

°£¤F¶]¦^°é¤§¥~
¦³­þºØ¤èªk¥i¥H±oª¾µ²ªG¶Ü?
¨Ò¦p·s¼W°}¦Ccc
dim cc: redim cc(1 to 2, 1 to 2)
µM«á±N¤ñ¹ïµ²ªG©ñ¤JCC°}¦C¸Ì­±?
PKKO

¦^´_ 1# PKKO
´N¬O¶]°j°é°Ú...¦³Ô£²z¥Ñ¤£¯à¶]°j°é
¦pªG·|°õ¦æ«Ü¦h¦¸³oºØ¹Bºâ¡A´N¥]¦¨Function
  1. '¤Gºû¯x°}°µAND
  2. Function MatrixAND2D(matrix1, matrix2)
  3.     If LBound(matrix1) <> LBound(matrix2) Or _
  4.         UBound(matrix1) <> UBound(matrix2) Or _
  5.         LBound(matrix1, 2) <> LBound(matrix2, 2) Or _
  6.         UBound(matrix1, 2) <> UBound(matrix2, 2) Then
  7.         Err.Raise vbObjectError + 9999, "MatrixAND()", "¨â¯x°}¤W¤U¼Ð¤£¦P"
  8.     End If
  9.    
  10.     Dim arResult, r, c
  11.     ReDim arResult(LBound(matrix1) To UBound(matrix1), LBound(matrix1, 2) To UBound(matrix1, 2)) As Boolean
  12.     For r = LBound(matrix1) To UBound(matrix1)
  13.         For c = LBound(matrix1, 2) To UBound(matrix1, 2)
  14.             arResult(r, c) = matrix1(r, c) And matrix2(r, c)
  15.         Next
  16.     Next
  17.     MatrixAND2D = arResult
  18. End Function

  19. Sub test()
  20.     Dim a(1 To 2, 1 To 2) As Boolean, b(1 To 2, 1 To 2) As Boolean
  21.     Dim c
  22.    
  23.     a(1, 1) = True: a(1, 2) = True: b(1, 1) = True
  24.     c = MatrixAND2D(a, b)
  25.     [a1].Resize(2, 2) = c
  26. End Sub
½Æ»s¥N½X
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

¦^´_ 2# stillfish00


    ·PÁÂS¤jªº¦^ÂÐ
¤p§Ì¥u¬O·Q...1=°½Ãi...2=³t«×´ú¸Õ
·Q»¡·|¤£·|¦³¤@¦æµ{¦¡½X¥i¥Hª½±µ¤ñ¹ï,¥B°õ¦æ³t«×¤ñ§Ú¶]¦^°é¤ñ¹ïÁÙ­n§Öªº¥i¯à©Ê
¦]¬°¦³®É·|¦³¤ñ¹ï»Ý¨D

¤£¹LÁÂÁ¤j¤jªº«Øij,¥]¦¨FUNCTION¬O«Ü¦nªº«Øij,³o¼Ëªº½T¥i¥H¹F¨ì­«½Æ§Q¥Îµ{¦¡½Xªº¥\¯à!
·PÁÂS¤j!!!
PKKO

TOP

        ÀR«ä¦Û¦b : ¤H­n¦Û·R¡A¤~¯à·R´¶¤Ñ¤Uªº¤H¡C
ªð¦^¦Cªí ¤W¤@¥DÃD