Author Topic: Help File Bug Report  (Read 160 times)

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 538
    • View Profile
Help File Bug Report
« on: August 09, 2020, 10:10:55 AM »
Hi Robert,

On the bottom of the VBScript page is Example 1


The line

 VBS_ADDCODE("Mydouble = ATAN(1.0) * 4.0")

should be

 VBS_ADDCODE("Mydouble = ATN(1.0) * 4.0")

Robert

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
Re: Help File Bug Report
« Reply #1 on: August 09, 2020, 02:02:50 PM »
Hi Robert,

On the bottom of the VBScript page is Example 1


The line

 VBS_ADDCODE("Mydouble = ATAN(1.0) * 4.0")

should be

 VBS_ADDCODE("Mydouble = ATN(1.0) * 4.0")

Hi MrBCX:

Code: [Select]

PRINT "PI = "; ATAN(1.0) * 4.0


works with Pelles and Microsoft.

 ???

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 538
    • View Profile
Re: Help File Bug Report
« Reply #2 on: August 09, 2020, 02:16:23 PM »
To be clear, it's not the compiling that's failing, it's the running.

ATAN is not a recognized BASIC keyword (in any BASIC that I've ever used). 
ATAN is a defined function in STD-C but VBSCRIPT doesn't know STD-C.

The correct (and traditional) BASIC keyword is ATN

Running the example with ATAN yields

0
ABCDEFGHIJKLMNOPQRSTUVWXYZ

as opposed to running with ATN

3.14159265358979
ABCDEFGHIJKLMNOPQRSTUVWXYZ
« Last Edit: August 09, 2020, 02:38:14 PM by MrBcx »

Robert

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
Re: Help File Bug Report
« Reply #3 on: August 09, 2020, 03:04:27 PM »
To be clear, it's not the compiling that's failing, it's the running.

ATAN is not a recognized BASIC keyword (in any BASIC that I've ever used). 
ATAN is a defined function in STD-C but VBSCRIPT doesn't know STD-C.

The correct (and traditional) BASIC keyword is ATN

Running the example with ATAN yields

0
ABCDEFGHIJKLMNOPQRSTUVWXYZ

as opposed to running with ATN

3.14159265358979
ABCDEFGHIJKLMNOPQRSTUVWXYZ

Hi MrBCX:

I should have run the example. My apologies.

Thank you for the explanation. I will change the several instances of ATAN in the Help file including the references to ATAN which were in Console Demos S24.bas and S133.bas until your recent revisions.

Check your S155.bas. The example in the Help file has the line

Code: [Select]

C# = ATAN(C1#) * C2#



Robert

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
Re: Help File Bug Report
« Reply #4 on: August 09, 2020, 03:16:52 PM »
To be clear, it's not the compiling that's failing, it's the running.

ATAN is not a recognized BASIC keyword (in any BASIC that I've ever used). 
ATAN is a defined function in STD-C but VBSCRIPT doesn't know STD-C.

The correct (and traditional) BASIC keyword is ATN

Running the example with ATAN yields

0
ABCDEFGHIJKLMNOPQRSTUVWXYZ

as opposed to running with ATN

3.14159265358979
ABCDEFGHIJKLMNOPQRSTUVWXYZ

Hi MrBCX:

I should have run the example. My apologies.

Thank you for the explanation. I will change the several instances of ATAN in the Help file including the references to ATAN which were in Console Demos S24.bas and S133.bas until your recent revisions.

Check your S155.bas. The example in the Help file has the line

Code: [Select]

C# = ATAN(C1#) * C2#


Hi MrBCX:

Forget about the S24 and S133 comment. In December 2016 I changed all instances of ATN to ATAN in the Help file. Reason? Probably not.

 

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 538
    • View Profile
Re: Help File Bug Report
« Reply #5 on: August 09, 2020, 04:08:04 PM »

C# = ATAN(C1#) * C2#
 

ATN and ATAN, when emitted by BCX, will likely always execute correctly when compiled by a C\C++ compiler. 

It's only when one attempts to use ATAN inside VBScript that ATAN is treated like a variable instead of like a function.

Robert

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
Re: Help File Bug Report
« Reply #6 on: August 09, 2020, 04:47:04 PM »

C# = ATAN(C1#) * C2#
 

ATN and ATAN, when emitted by BCX, will likely always execute correctly when compiled by a C\C++ compiler. 

It's only when one attempts to use ATAN inside VBScript that ATAN is treated like a variable instead of like a function.

Hi MrBCX:

For consistency and keeping with Classic BASIC syntax,I have changed all instances of ATAN to ATN.

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 538
    • View Profile
Re: Help File Bug Report
« Reply #7 on: August 09, 2020, 05:52:59 PM »

For consistency and keeping with Classic BASIC syntax,I have changed all instances of ATAN to ATN.


+1