Issues of stdRefArray
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- visualbasic
- Ambito
- tooling
Direzione di ricerca
Start by locating the stdRefArray implementation and reproducing the TeststdRefArray2 and TeststdRefArray3 examples from the issue. Compare the current array access behavior with the requested VarPtrArr and default-property behavior, then verify that both examples produce the stated reads and writes without changing the intended reference semantics.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
- VarPtrArr shall be reurn the pointer of the safearray address.
#If Win64 Then
Private Function VarPtrArr(ByRef arr As Variant) As LongLong
#Else
Private Function VarPtrArr(ByRef arr As Variant) As Long
#End If
Dim vt As VbVarType
Dim p As Long
p = VarPtr(arr)
CopyMemory vt, ByVal p, 2
If (vt And vbArray) = vbArray Then '//安全数组
VarPtrArr = PtrAdd(p, 8) 'VARIANT结构中wReserved2的地址
If (vt And &H4000) = &H4000 Then '//引用类型VT_BYREF,如果是引用类型则wReserved2的值才是数组地址的地址
CopyMemory VarPtrArr, ByVal VarPtrArr, PTR_SIZE
End If
End If
End Function
Private Function PtrAdd(ByVal Ptr As LongPtr, ByVal iOffset As Long) As LongPtr
' For adding (or subtracting) a small number from a pointer.
' Use PtrAddEx for adding (or subtracting) large numbers from a pointer.
PtrAdd = (Ptr Xor &H80000000) + iOffset Xor &H80000000
End Function
- It is better to provide a default property to use it like a real array. But there is some CopyMemory cost that it shall not be used in a loop
Property Get GetData()
Attribute GetData.VB_UserMemId = 0
Call CopyMemory(GetData, data, 16)
End Property
Sub TeststdRefArray2()
Dim arr As Variant: arr = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
Dim rarr As stdRefArray: Set rarr = stdRefArray.Create(arr)
Debug.Print rarr(1) '=> 2
rarr(1) = 3
Debug.Print rarr(1) '=> 3
Debug.Print rarr(2) '=> 3
End Sub
Sub TeststdRefArray3()
Dim arr As Variant: arr = [M1:M3]
Dim rarr As stdRefArray: Set rarr = stdRefArray.Create(arr)
Debug.Print rarr(1, 1) '=> 2
rarr(1, 1) = 3
Debug.Print rarr(1, 1) '=> 3
Debug.Print rarr(2, 1) '=> 3
End Sub
- Lingua principale
- VBA
- Stelle
- 412
- Fork
- 70
- Merge medio
- 17h 22m
- PR unite (30g)
- 22
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di sancarn/stdVBA
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
sancarn/stdVBA#140 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
sancarn/stdVBA#138 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature] `stdArray` add mechanism for copying an array byrefForse già presa @sancarn l’ha presa 3 giorni fa. Apertaenhancement lib-stdArray
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
-
`stdUIElement` megathreadApertaenhancement megathread
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di sancarn/stdVBA
Issue simili
-
needs-area-label
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
gitbutlerapp/gitbutler#16982 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
TransformerLensOrg/TransformerLens#1980 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 79/100