Author Topic: Where is O2?  (Read 6069 times)

0 Members and 1 Guest are viewing this topic.

edcronos

  • Guest
Re: Where is O2?
« Reply #15 on: May 29, 2018, 06:52:48 AM »
what spoils is that there is no "Basic"
there is only (visual) basic, (O2) basic, (free) basic, (power) basic, among many other variants that are not compatible at all,

basic still exists only for its exciting ease of use and its logic closer to the routine of the day to day to automate small ideas quickly even for those who have just started

any one understands a For To next loop after a single explanation, unlike C for (int i = 0; i <10; i ++) it still has to be counted the "}" to know where the loop ends, outside the logic operations, okay after a time of use assimilates the syllabic, but in basic this is almost instant because it is already rooted in this
« Last Edit: May 29, 2018, 08:20:28 AM by edcronos »

edcronos

  • Guest
Re: Where is O2?
« Reply #16 on: May 29, 2018, 11:27:32 AM »
... I ask the freedom to open a topic for my adventures with O2 in the VBA ...

By all means, you're welcome to do so here on this Problems & Solutions board.
I'm kind of messed up in ideas, but I'll try to be a little clearer,
It's hard for anyone to come from excel, but it can be something of a parameter for possible interest.

jalih

  • Guest
Re: Where is O2?
« Reply #17 on: May 29, 2018, 11:56:00 AM »
...there is only (visual) basic, (O2) basic, (free) basic, (power) basic, among many other variants that are not compatible at all,

basic still exists only for its exciting ease of use and its logic closer to the routine of the day to day to automate small ideas quickly even for those who have just started

any one understands a For To next loop after a single explanation, unlike C for (int i = 0; i <10; i ++) it still has to be counted the "}" to know where the loop ends, outside the logic operations, okay after a time of use assimilates the syllabic, but in basic this is almost instant because it is already rooted in this

I see no problem with incompatible syntax between Basic variants. If you master one programming language, another programming language can be learned real fast. I personally would like to see Basic evolve from C style arrays ( please, give me slicing or cross section of arrays ) and poor pointer implementation with excessive need for casting ( PL/I had it right ).

What comes to looping: you really only need DO loop.  ;)

edcronos

  • Guest
Re: Where is O2?
« Reply #18 on: May 29, 2018, 12:03:05 PM »
Quote
I see no problem with incompatible syntax between Basic variants

the problem in incompatible syntax is not with the creation of projects, but in reuse of code and portability of projects
also has the fact of lack of support of one or another developer, use of tools, and does not work well that of who knows one knows all, only has the basis of atability

nor does the basic concept of Basic keep from one to the other,
an example is the use of array in O2
I for example use Goto to skip blocks of loops and if nested
in the thin basic does not even have the primitive function like goto, I would have to set a new mode of operation for what I already do normally
« Last Edit: May 29, 2018, 12:37:10 PM by edcronos »

JRS

  • Guest
Re: Where is O2?
« Reply #19 on: May 29, 2018, 07:25:03 PM »
I think what you're looking for is a language like Script BASIC which has a COM/OLE automation  CallByName  interface. PHP is also a good choice which has a slick COM/OLE automation API and even can access .NET assembles.

Charles has a beginning of a COM interface working that is demonstrated with a SAPI example.

Here is the Script BASIC SAPI example.using DLLC.

Code: Script BASIC
  1. 'SAPI - COM SPEECH
  2.  
  3. DECLARE SUB DLLC_FILE ALIAS "dllfile" LIB "DLLC"
  4. DECLARE SUB DLLC_PROC ALIAS "dllproc" LIB "DLLC"
  5. DECLARE SUB DLLC_GUID ALIAS "dllguid" LIB "DLLC"
  6. DECLARE SUB DLLC_METH ALIAS "dllmeth" LIB "DLLC"
  7. DECLARE SUB DLLC_RECO ALIAS "dllreco" LIB "DLLC"
  8. DECLARE SUB DLLC_WSTR ALIAS "dllwstr" LIB "DLLC"
  9. DECLARE SUB DLLC_CALL ALIAS "dllcall" LIB "DLLC"
  10. DECLARE SUB DLLC_ASTR ALIAS "dllastr" LIB "DLLC"
  11. DECLARE SUB DLLC_COBJ ALIAS "dllcobj" LIB "DLLC"
  12.  
  13. ole32 = DLLC_FILE("ole32.dll")
  14.  
  15. CoInitialize     = DLLC_PROC(ole32, "CoInitialize (i)")
  16. CoUninitialize   = DLLC_PROC(ole32, "CoUninitialize (i)")
  17. CoCreateInstance = DLLC_PROC(ole32, "CoCreateInstance i=(t*ObjGuid ,i pUnkOuter,i context, t*IspGuid, i*Iface)" )
  18.  
  19. VoiceObjGuid = DLLC_GUID("96749377-3391-11D2-9EE3-00C04F797396")
  20. ISpVoiceGuid = DLLC_GUID("6C44DF74-72B9-4992-A1EC-EF996E0422D4")
  21. Context      = 7
  22. pUnkOuter    = 0
  23. Voice        = 0
  24. Release      = DLLC_METH( 2, "Release i=()")
  25. Speak        = DLLC_METH(20, "Speak i=(z*pwcs,i flags,i pulstreamno)")
  26. WaitUntilDone= DLLC_METH(32, "WaitUntilDone i=(i)")
  27. PRINT DLLC_RECO(speak)
  28. Text         = DLLC_WSTR("Hello World\0")
  29. hr = 0
  30. DLLC_CALL(CoInitialize, 0)
  31. hr = DLLC_CALL(CoCreateInstance, VoiceObjGuid, pUnkouter, Context, ISpVoiceGuid, Voice)
  32. IF (hr = 0) THEN
  33.   PRINT "connected to voice\n\n"
  34.   PRINT DLLC_ASTR(Text) & "\n\n"
  35.   DLLC_COBJ(Voice, Speak, Text, 0, 0)
  36.   DLLC_COBJ(Voice, WaitUntilDone, 0xFFFFFFFF)
  37.   DLLC_COBJ(Voice, Release)
  38. ELSE
  39.   PRINT "SAPI Error " & FORMAT("%x", hr) & "\n\n"
  40. END IF
  41. DLLC_CALL(CoUninitialize)
  42.  
  43. DLLC_FILE
  44.  

I have been thinking of creating a version of Script BASIC that focuses on O2 embedded  aspects of DLLC and call it ScriptO2.  This would allow full use of SB (using its COM ext.) as a core language with both O2 JIT (with a dynamic FFI) and easy to use C based extension API.
« Last Edit: May 29, 2018, 08:30:23 PM by John »

edcronos

  • Guest
Re: Where is O2?
« Reply #20 on: June 01, 2018, 01:14:15 PM »
Arnold

the right thing is to wait for the BETA version to be ready to define a documentation strategy
There is a lot to be done.
for example a listing of functions and commands
and from there go putting explanations and examples of functioning
a clear explanation of O2 programming structure
types of variables, sizes, uses and scope

edcronos

  • Guest
Re: Where is O2?
« Reply #21 on: June 02, 2018, 01:28:07 AM »
is there a list of O2 functions and commands?
it is not necessary to have examples and explanations

Mike Lobanovsky

  • Guest
Re: Where is O2?
« Reply #22 on: June 02, 2018, 01:41:12 AM »
FYI: The "O2 Multidimensional Arrays" spin-off has been split into a separate topic here.

JRS

  • Guest
Re: Where is O2?
« Reply #23 on: June 21, 2018, 05:48:57 PM »
I think Charles made a good point when he said O2 will be what he wants it to be, nothing more or less.

I don't think O2 should try to be another PowerBASIC or any other past BASIC flavor. You best know the Windows API if you plan to use it in it's current form.

How do others feel about O2 offering compatibility with macros?
« Last Edit: June 21, 2018, 10:05:49 PM by John »