Author Topic: VBS  (Read 349 times)

Robert

  • Sr. Member
  • ****
  • Posts: 449
    • View Profile
VBS
« on: June 28, 2020, 09:09:55 PM »
Pelles C 10.0 can not deal with the following example. Not even VBS_START. I can't remember if the VBS stuff ever worked with Pelles C.

Microsoft compilers O.K.

Code: [Select]
CLS
 
VBS_START
 
VBS_ADDCODE("Dim Mystring, Mydouble")
VBS_ADDCODE("Dim I: For I = 65 To 65 + 25: Mystring=Mystring + Chr(I): Next")
VBS_ADDCODE("Mydouble = ATAN(1.0) * 4.0")
 
COLOR 11,0
 
PRINT VBS_EVAL_NUM#("Mydouble") 'displays 3.14159265358979
PRINT VBS_EVAL_STR$("Mystring") 'displays ABCDEFGHIJKLMNOPQRSTUVWXYZ

VBS_RESET
 
VBS_RUN_SCRIPT("Msgbox " & ENC$("BCX Called VBSCRIPT MsgBox Function"))
VBS_STOP
 
COLOR 7,0

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 538
    • View Profile
Re: VBS
« Reply #1 on: June 28, 2020, 09:35:50 PM »
Pelles C 10.0 can not deal with the following example. Not even VBS_START. I can't remember if the VBS stuff ever worked with Pelles C.

Microsoft compilers O.K.

Code: [Select]
CLS
 
VBS_START
 
VBS_ADDCODE("Dim Mystring, Mydouble")
VBS_ADDCODE("Dim I: For I = 65 To 65 + 25: Mystring=Mystring + Chr(I): Next")
VBS_ADDCODE("Mydouble = ATAN(1.0) * 4.0")
 
COLOR 11,0
 
PRINT VBS_EVAL_NUM#("Mydouble") 'displays 3.14159265358979
PRINT VBS_EVAL_STR$("Mystring") 'displays ABCDEFGHIJKLMNOPQRSTUVWXYZ

VBS_RESET
 
VBS_RUN_SCRIPT("Msgbox " & ENC$("BCX Called VBSCRIPT MsgBox Function"))
VBS_STOP
 
COLOR 7,0

Robert,

I translated the code with 746 and 747 and compiled to 32-bit using Lccwin32 and Pelles v10. 

Both yielded the same results when run ... see scrnshot


Mingw and Clang threw numerous errors that I've not studied.


MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 538
    • View Profile
Re: VBS
« Reply #2 on: June 28, 2020, 09:42:02 PM »
Correction #1:  version compiled with clang++ executes correctly ( I forgot to explicitly specify -m32)

Correction #2:
  Runs correctly compiling with g++ using the following switches:

g++ vbtest.cpp -m32  -lole32 -loleaut32
« Last Edit: June 28, 2020, 09:51:30 PM by MrBcx »

Robert

  • Sr. Member
  • ****
  • Posts: 449
    • View Profile
Re: VBS
« Reply #3 on: June 28, 2020, 09:55:49 PM »
Pelles C 10.0 can not deal with the following example. Not even VBS_START. I can't remember if the VBS stuff ever worked with Pelles C.

Microsoft compilers O.K.

Code: [Select]
CLS
 
VBS_START
 
VBS_ADDCODE("Dim Mystring, Mydouble")
VBS_ADDCODE("Dim I: For I = 65 To 65 + 25: Mystring=Mystring + Chr(I): Next")
VBS_ADDCODE("Mydouble = ATAN(1.0) * 4.0")
 
COLOR 11,0
 
PRINT VBS_EVAL_NUM#("Mydouble") 'displays 3.14159265358979
PRINT VBS_EVAL_STR$("Mystring") 'displays ABCDEFGHIJKLMNOPQRSTUVWXYZ

VBS_RESET
 
VBS_RUN_SCRIPT("Msgbox " & ENC$("BCX Called VBSCRIPT MsgBox Function"))
VBS_STOP
 
COLOR 7,0

Robert,

I translated the code with 746 and 747 and compiled to 32-bit using Lccwin32 and Pelles v10. 

Both yielded the same results when run ... see scrnshot


Mingw and Clang threw numerous errors that I've not studied.

Hi MrBCX:

Thanks for this. I recompiled from the command line instead of a batch file from Jens File Editor and all is well.

Odd ...

Robert

  • Sr. Member
  • ****
  • Posts: 449
    • View Profile
Re: VBS
« Reply #4 on: June 28, 2020, 09:58:42 PM »
Pelles C 10.0 can not deal with the following example. Not even VBS_START. I can't remember if the VBS stuff ever worked with Pelles C.

Microsoft compilers O.K.

Code: [Select]
CLS
 
VBS_START
 
VBS_ADDCODE("Dim Mystring, Mydouble")
VBS_ADDCODE("Dim I: For I = 65 To 65 + 25: Mystring=Mystring + Chr(I): Next")
VBS_ADDCODE("Mydouble = ATAN(1.0) * 4.0")
 
COLOR 11,0
 
PRINT VBS_EVAL_NUM#("Mydouble") 'displays 3.14159265358979
PRINT VBS_EVAL_STR$("Mystring") 'displays ABCDEFGHIJKLMNOPQRSTUVWXYZ

VBS_RESET
 
VBS_RUN_SCRIPT("Msgbox " & ENC$("BCX Called VBSCRIPT MsgBox Function"))
VBS_STOP
 
COLOR 7,0

Robert,

I translated the code with 746 and 747 and compiled to 32-bit using Lccwin32 and Pelles v10. 

Both yielded the same results when run ... see scrnshot


Mingw and Clang threw numerous errors that I've not studied.

Hi MrBCX:

Thanks for this. I recompiled from the command line instead of a batch file from Jens File Editor and all is well.

Odd ...

Yeah, well, not odd. The batch file was for 64 bit. Duh ....

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 538
    • View Profile
Re: VBS
« Reply #5 on: June 28, 2020, 10:01:16 PM »

Yeah, well, not odd. The batch file was for 64 bit. Duh ....

That's your mulligan for the day  :)