Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

stdProgress

Abierto
#38 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
32/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
visualbasic
Área
desktop, tooling

Línea de trabajo

Start by locating the stdProgress entry point in the VBA library and map the constructors and instance methods listed in the spec. Review the examples to understand nested progress, form or frame binding, Step, self, and Finish behavior. Done means the listed API and the three demonstrated usage patterns work as described.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement lib-stdProgress

stdProgress

Concept

The concept is to be able to build a Progress object, which can continuously sub-divide progress (and ultimately update a progress bar). This progress object could also be supplied as a parameter to functions which increases the ease of using it as a progress meter.

Example 1:
With stdProgress.CreateFromPercents(0.9,0.1).bindForm(myProgressBar)
  Dim allSheetNames as collection: set allSheetNames = new collection
  With .CreateFromCount(workbooks.count)
    For each wb in workbooks
      With .CreateFromCount(wb.sheets.count)
        for each sheet in wb.sheets
          allSheetNames.add sheet.name
          .step
        next
      End With
    next
  End With
  With .CreateFromCount(allSheetNames.count)
      Dim vSheetName
      for each vSheetName in allSheetNames
        debug.print vSheetName
        .step
      next
  End with
End With
  1. We divide the work into a 0.9 and 0.1 split, i.e. 90% and 10%.
  2. We subdivide the 90% into workbook.count parts. Assume 2 workbooks are open, so that's 45% each.
  3. We subdivide the 45% into wb.sheets.count parts. Assume 5 sheets per workbook so 9% per sheet.
  4. We step for every sheet name added to the workbook incrementing up the tree till the parent, which updates the form.
  5. Upon finishing we've updated 90% of the progress, 10% remains
  6. We divide this 10% into the number of sheets (10) so 1% for each sheet.
  7. Each sheet we increment by this value
  8. We unload the object as progress is completed
Example 2
With stdProgress.CreateFromCount(3)
  'do some task
  .step()
  'do some other task
  .step()
  'do some other task
  .step() 'optional, as the progress bar will unload immediately after this method in this case
End With
Example 3
Sub test(pb)
  with pb.CreateFromCount(workbooks.count)
    for each wb in workbooks
      if wb.name = sName then
        debug.print workbook.fullname
        pb.finish
        exit function
      end if
    next
  end with
End Sub

Spec

  • Constructors
    • stdProgress::CreateFromPercents(Paramarray params())
    • stdProgress#CreateFromPercents(Paramarray params())
    • stdProgress::CreateFromCount(iPartsCount as long)
    • std{rpgress#CreateFromCount(iPartsCount as long) - split progress evenly amongst N parts
    • self - Returns Me
  • Instance methods
    • bindForm(Optional Byval oUF as object, ByVal sUpdateMethodName as string) - binds a form with an update method, if no form supplied just return self
    • bindFrame(Optional ByVal fr as frame) - binds a frame, the progress object will insert labels into the frame to visualise progress. If no fram supplied just return self
    • Step - steps forward by 1 step of progress. Default is 0.01 if created from percents, otherwise it's 1 from counts.
    • Finish - call if you need to urgently finish the progress accumulated.
Lenguaje dominante
VBA
Estrellas
412
Forks
70
Merge medio
1 d 3 h
PR fusionados (30 d)
4

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de sancarn/stdVBA

Todos los issues de sancarn/stdVBA

Issues similares

Más issues de Desktop Dev

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.