2

this is an very odd question.

I have a client, which needs an updated version of his program. He gave me all the old files, told me it was an Visual Basic Program, from 1995.

As I am born in 2002, I did not realize that Visual Basic did not even exist back then.

Anyway, the syntax seems to be the same

VERSION 2.00
Begin Form REDACTED 
   BackColor       =   &H00C0C0C0&

...

Dim ja
Dim lwi1(6) As Double
Dim lwaa(6) As Double
Dim lwa(6) As Double
Dim rr(6) As Double

Then I saw the following line

zwert1 = lg(1# - x) / lg(1# - xcr)

And tried to find the documentation for lg().

After searching for about an hour I gave up. I think its log(), but im not sure, and also I'm confused what kind of language this is written in, there are some PowerPascal (??) files dated in 1989, and the filetype of the cited code is '.frm'.

I feel like I am in a museum, without documentation or a guide.

Can anyone help me figure out what language this is, and what lg() achieves?

Altay Akkus
  • 325
  • 1
  • 10
  • 1
    It probably is _log10_ of Visual Basic 4: [Logarithm(log, lg, ln)](https://www.math10.com/en/algebra/logarithm-log-ln-lg.html) – Gustav Jun 11 '21 at 20:25
  • 1
    @Gustav makes sense! It only has one input, that seems to be it. If you pack this into a question I can mark it is as solved :) – Altay Akkus Jun 11 '21 at 20:32
  • OK, I've moved it to the answer. – Gustav Jun 12 '21 at 06:52
  • Just to add historical facts: Visual Basic started to be around since the early 90´s (as far as I remember: 91 or very early 92 - I bought my VB 1 license) – nabuchodonossor Jun 20 '21 at 15:25

1 Answers1

2

It probably is log10 of Visual Basic 4: Logarithm(log, lg, ln)

Here's a substitute for VBA:

Public Function Log10( _
    ByVal Value As Double) _
    As Double

' Returns Log 10 of Value.
' 2015-08-17. Gustav Brock, Cactus Data ApS, CPH.

    Const Base10    As Double = 10

    ' No error handling as this should be handled
    ' outside this function.
    '
    ' Example:
    '
    '     If MyValue > 0 then
    '         LogMyValue = Log10(MyValue)
    '     Else
    '         ' Do something else ...
    '     End If
    
    Log10 = Log(Value) / Log(Base10)

End Function
Gustav
  • 53,498
  • 7
  • 29
  • 55
  • 1
    Thank you, but I am rebuilding it for the Web in PHP. But you also recognized that it is logarithm to the base of 10, I would not have come up with that in a 100 years! – Altay Akkus Jun 11 '21 at 20:33
  • 1
    Remember to mark it as the accepted answer, not just upvote. – Bill Hileman Jun 12 '21 at 10:22