Friday, November 17, 2017

Prediction-correction method

'***********************************************************
'*        SOLVING DIFFERENTIAL EQUATIONS OF ORDER 1        *
'*             (Prediction-correction method)              *
'* ------------------------------------------------------- *
'* Reference:                                              *
'*   "Analyse en Turbo Pascal versions 5.5 et 6.0 By Marc  *
'*    DUCAMP et Alain REVERCHON - Eyrolles, Paris 1991"    *
'*    [BIBLI 03].                                          *
'*                                                         *
'*                    Basic version by J-P Moreau, Paris   *
'*                            (www.jpmoreau.fr)            *
'* ------------------------------------------------------- *
'* SAMPLE RUN:                                             *
'* (Integrate y'=(4xy+4x*sqrt(y))/(1+xý) from x=0 to x=10  *
'*  with initial condition y(0)=1)                         *
'*                                                         *
'*  Input x begin: 0                                       *
'*  Input x end  : 10                                      *
'*  Input y begin: 1                                       *
'*  Input number of points: 10                             *
'*  Input finesse: 10                                      *
'*                                                         *
'*         X               Y                               *
'*  -----------------------------                          *
'*     1.000000         8.999984                           *
'*     2.000000        80.999881                           *
'*     3.000000       360.999496                           *
'*     4.000000      1088.998512                           *
'*     5.000000      2600.996484                           *
'*     6.000000      5328.992838                           *
'*     7.000000      9800.986875                           *
'*     8.000000     16640.977767                           *
'*     9.000000     26568.964559                           *
'*    10.000000     40400.946171                           *
'*  -----------------------------                          *
'*                                                         *                                                    *
'***********************************************************
DefInt I-N
DefDbl A-H, O-Z

  MAXDATA = 100

  Dim tx(MAXDATA), ty(MAXDATA)
  'integer ifi, n

  Cls
  Print
  input " Input x begin: ", xi
  input " Input x end  : ", xf
  input " Input y begin: ", yi
  input " Input number of points: ", n
  input " Input finesse: ", ifi

  GoSub 3000  'call equadiff_pc(tx,ty,xi,xf,yi,n,ifi)

' print results
  f$ = "#####.######     #####.######"
  Print
  Print "       X                Y     "
  Print " -----------------------------"
  For i = 1 To n
    Print using; f$; tx(i); ty(i)
  Next i
  Print " -----------------------------"
  Print

End 'of main program

1000  'Function y'=(4xy+4x*sqrt(y))/(1+xý)
  If yy > 0 Then
    f = (4 * xx * yy + 4 * xx * Sqr(yy)) / (1 + xx * xx)
  Else
    f = 0
  End If
Return

2000 'classical Runge-Kutta method of order 4
  xx = X: yy = y: GoSub 1000: a = h * f
  xx = X + h / 2: yy = y + a / 2: GoSub 1000: B = h * f
  yy = y + B / 2: GoSub 1000: c = h * f
  X = X + h: xx = X: yy = y + c: GoSub 1000: d = h * f
  y = y + (a + B + B + c + c + d) / 6
Return

  '**********************************************************
  '*             Prediction-correction method               *
  '* ------------------------------------------------------ *
  '* INPUTS:                                                *
  '*           xi      begin x value                        *
  '*           xf      end x value                          *
  '*           yi      begin y value (at x=xi)              *
  '*           n       number of points to calculate        *
  '*           ifi     finesse (number of intermediate      *
  '*                   points (for example 10)              *
  '* OUTPUTS:                                               *
  '*           tx      table of x values (m values)         *
  '*           ty      table of y values (m values)         *
  '*                                                        *
  '* DESCRIPTION:                                           *
  '* The algorithm has the following steps:                 *
  '*     1. calculate y2, y3, y4 using a classical Runge-   *
  '*        Kutta method of order 4.                        *
  '*     2. from point (x4, y4), first estimate y(n+1) by   *
  '*        formula:                                        *
  '*        y(n+1)=y(n) + h/24(55y'(n)-59y'(n-1)+37y'(n-2)  *
  '*               -9y'(n-3)                                *
  '*        then continue with formula:                     *
  '*        y(n+1)=y(n) + h/24(9y'(n+1)+19y'(n)-5y'(n-1)    *
  '*               +y'(n-2),                                *
  '*        noting that y'(n+1)=f(x(n+1),y(n+1)) with the   *
  '*        estimated value of y(n+1), until convergence is *
  '*        obtained.                                       *
  '**********************************************************
3000 'Subroutine equadiff_pc(tx, ty, xi, xf, yi, n, ifi)
  Dim p(3)
  z = yi
  m = n
  If (m > MAXDATA) Or (ifi < 1) Then Return
  h = (xf - xi) / ifi / m
  xx = xi: yy = yi: GoSub 1000: p(3) = f
  tx(0) = xi: ty(0) = yi
  k = 0
  For i = 1 To m
    ni = (i - 1) * ifi - 1
    For j = 1 To ifi
      X = xi + h * (ni + j)
      k = k + 1
      If (k < 4) Then
        'call runge_kutta(h,x,z)
        y = z: GoSub 2000: z = y
    xx = X: yy = z: GoSub 1000: p(3 - k) = f
      Else
    X = X + h
        w = z + (h / 24) * (55 * p(0) - 59 * p(1) + 37 * p(2) - 9 * p(3))
        'continue
10  y = w
          xx = X: yy = y: GoSub 1000
          w = z + (h / 24) * (9 * f + 19 * p(0) - 5 * p(1) + p(2))
        If Abs(y - w) > 0.0000000001 Then GoTo 10
    z = w: p(3) = p(2): p(2) = p(1)
    p(1) = p(0): xx = X: yy = z: GoSub 1000: p(0) = f
      End If
    Next j 'j loop
    tx(i) = X: ty(i) = z
  Next i 'i loop
Return

' end of file teqdifpc.bas

Tuesday, November 14, 2017

VB6 graph control

This project is from Woka, one of the VB6 community fighters. I do not know anything about Woka but I see it made a gorgeous chart with relatively wide applicability. Thank you Woka !

Download from me and me v2

Download from source

I have written a small compact graph usercontrol control.

Features:
Squigillians of points
Draw Line Graph
Draw Bar Graph
All Custom Colors
Draw Points
Draw Axis
Fixed Items
Save ALL grid and point properties to a file
Load a graph from a saved file

I think that's it.
With the graph it's possible to do the following:
Draw a moving graph, like you see in task manager
Draw a histogram, bar and line graphs
Draw mathematical equations, like Sin Wave or x^2
Draw a moving music graphic equaliser thingy like in media player
Create a progress bar


It's something I knocked up in the last 24hrs. I can't find any bugs, but I am sure one of the little bastards is still lurking around

Any comments or suggestions would be great.

Cheers.

Woka











Visual Basic 6.0 has a total of 22 million dedicated videos on Youtube


Visual Basic 6.0 has a total of 22 million videos on Youtube. This shows how active a community can be. For instance, 764,000 results are shown for "VB6". About 14,600,000 results are shown for "Visual Basic 6.0" and about 6,260,000 results are shown for "Visual Basic" ("Visual Basic" is the general term for Visual Basic 6.0, Visual Basic 5.0). Not to mention that many of the uploaded video files are related to VB6 but "VB6" as a keyword is not mentioned in the title or description. For instance, one of the known programmers (MiorSoft (reexre)) that makes advanced (better than anything that Google has) open source Neural Networks in Visual Basic 6.0, does not mention the programming language. (Ex1Ex2Ex3Ex4).

Good job VB6 community, continue to post !






Thursday, October 26, 2017

Visual Basic 6.0 is an attractor for the young intelligent minds


Up to my last count in 2014, there have been around 200 pages dedicated to VB6 on FaceBook. I am subscribed to one of the very active pages, namely https://www.facebook.com/MicrosoftVB/. I asked the administrators this page if they had something related to the VB6 programmers age data. They did more than send me data, they gave me access to their statistics. The current number of programmers subscribed to the page in 2017 is 13 thousand. Not just that young minds prefer VB6, but new blood comes to the VB6 community and not to the other communities. While in general the trend of using a language is artificially maintained by different companies and groups, the Visual Basic 6.0 language has a natural trend, it's like an attractor for the intelligent minds. Of 13,000 programmers this is the age distribution on the https://www.facebook.com/MicrosoftVB/:









Here's an example with a video that was posted over a single day





Sunday, October 22, 2017

Microsoft say "It is not feasible to open source VB6 tools chain and ecosystem." Why ?

Microsoft say of the VB6 programming language "In summary, VB6 was awesome. We agree. We don’t expect or demand anyone to throw away their code or rewrite from any of our technologies unless it makes business sense for them to do so. We have to innovate to enable our customers to innovate. It is not a viable option to create a next version of VB6. We stand by our decision to make VB.NET and the .NET Framework. We think they are awesome too. It is not feasible to open source VB6 tools chain and ecosystem." - Paul Yuknewicz, Group Program Manager, June 3, 2014.
It does not make business sense to have to rewrite VB6 applications. And yet without an updated or open source VB6 you are forcing VB6 developers to move to a different language.
Why is it "not a viable option to create a next version of VB6" ?
Why is it "not feasible to open source VB6 tools chain and ecosystem" ?
You have updated the VBA programming language from VBA6 to VBA7.x. Exactly why can't you do this for VB6 ?
You have open sourced much of .Net. Exactly why can't you open source VB6 ?
by


Saturday, October 21, 2017

Visual Basic 6.0 by default on Windows

Windows has many tools by default like Paint or Notepad. What is missing in the tool arsenal is a programming language. Visual Basic 6.0 seems to be extraordinarily well suited since is particularly powerful, fast and with millions of programmers.

In the community, it was concluded that Microsoft may not have powerful specialists on the programming languages side like they had in the 90's and that would be one of the reasons why they can not make a new Visual Basic 6.X version.

Another reason in the community gossip would be that they no longer have the source code of the Visual Basic 6.0 programming language probably due to data corruption.

The list of suspicions is long as Microsoft tried to break the support for VB6 in 2008, but they could not do that because of the masses of programmers who have resisted.

Another false information would be that VB6 programmers do not want to go to other languages, but as far as I know personally, VB6 programmers know a very wide range of languages, especially C++, Java, PHP and ASM.

The support for VB6 is now guaranteed by Microsoft until 2027. So it will survive longer than most of the programming packages released right now.

Such an idea would be very constructive for Windows 10 and future variants.