Recent posts

#1
OxygenBasic / Re: word WordValue at strptr(s...
Last post by Pierre Bellisle - Today at 12:19:19 AM
Hi Charles and Aurel,
I work with both wstring and string.
For this question I wrote a demo that do not use wide character.

I made different variation of "word WordLen at strptr(sText) = CharCount"
Look for "choice" in code
I got a non assigned value in one case, I got a gpf on reassigment try,
and a good result which the normal behavior, now that I'm aware of it.

Thank for the answer.

Note: If you revisit the help file, might be good to say
that "sText = string(CharCount, 0) 'zero to nine "
is the equivalent of  "sText = string(CharCount, "0")"
and to obtain a string made of nul like
"sText = nuls(CharCount)" you have to add "chr()" like in
"sText = string(CharCount, chr(0))"

//KickResource "D:\Dev\Oxygen\o2\~code\~~~Resource.res" //kick add a manifest for CommonControl-6
//KickSwitch -32 //compile to 32bit
//KickEnd //optional, end of kick instructions

% Edit01 102
% lText01 201
% CheckboxTopMost 301

% DEFAULT_GUI_FONT 17
% GCL_HICON -14
% SWP_NOSIZE 1
% HWND_NOTOPMOST 0xFFFFFFFE

uses dialogs
'____________________________________________________________________________

function DialogProc(sys hDlg, uint uMsg, sys wParam, lParam) as int callback

select case uMsg

  case WM_INITDIALOG

    sys hIcon = ExtractIcon(GetModuleHandle(""), "Shell32.dll", 294) 'o
    SetClassLongPtr(hDlg, GCL_HICON, hIcon)

    sys hEdit = GetDlgItem(hDlg, Edit01)

    sys hFont = CreateFont(14, 0,      'Height 14 = 9, 16=12, 15=11, 14=11, Width usually 0,
                            0, 0,      'Escapement(angle), Orientation
                            0, 0, 0, 0, 'Bold, Italic, Underline, Strikethru
                            0, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS,
                            DEFAULT_QUALITY, FF_DONTCARE, "Consolas") 'Fixed width font ("Segoe UI", 9 Arial Consolas)

    SendMessage(hEdit, WM_SETFONT, hFont, 0)
    SendMessage(GetDlgItem(hDlg, IDCANCEL), WM_SETFONT, GetStockObject(DEFAULT_GUI_FONT), 0)
    SendMessage(GetDlgItem(hDlg, lText01), WM_SETFONT, GetStockObject(DEFAULT_GUI_FONT), 0)
    SendMessage(GetDlgItem(hDlg, CheckboxTopMost), WM_SETFONT, GetStockObject(DEFAULT_GUI_FONT), 0)

    PostMessage(hEdit, %EM_SETSEL, -1, 0) 'Set caret at the end of text
    return true

  case WM_COMMAND
    select case loword(wParam)

      case IDCANCEL
        if hiword(wParam) = BN_CLICKED OR hiword(wParam) = 1
          EndDialog(hDlg, null)
        end if

      case Edit01
        if hiword(wParam) = EN_CHANGE 'OR hiword(wParam) = 1
          word CharCount = SendMessage(GetDlgItem(hDlg, Edit01), EM_LINELENGTH, 0, 0)
          string sText = nuls(CharCount)

          if CharCount = 1 then CharCount = 2 'EM_GETLINE need at least 2 to work on a one char string,
          '--------------------------------------
          long choice = 2 'try 1, 2, or 3
          '-
          if choice = 1 'bad, value is not assigned to CharCount
            word WordLen at strptr(sText) = CharCount
          end if
          '-
          if choice = 2 'ok, value is assigned to CharCount
            word WordLen at strptr(sText)
            WordLen = CharCount
          end if
          '-
          if choice = 3 'gpf, reassigmnet will gpf
            word WordLen at strptr(sText) = CharCount
            WordLen = CharCount
          end if
          '--------------------------------------
          long retval = SendDlgItemMessage(hDlg, Edit01, EM_GETLINE, 0, STRPTR(sText))
          SetWindowText(GetDlgItem(hDlg, lText01), "[" + sText + "] len " & str(len(sText)) & ", count from em_getline " & str(retval))
        end if

      case CheckboxTopMost
        if hiword(wParam) = BN_CLICKED OR hiword(wParam) = 1
          if IsDlgButtonChecked(hDlg, CheckboxTopMost)  then
            SetWindowPos(hDlg, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE)
          else
            SetWindowPos(hDlg, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE)
          end if
        end if
    end select

  case WM_CLOSE
    EndDialog(hDlg, null)

  case WM_DESTROY
    DeleteObject(hFont)
    DestroyIcon(hIcon)

end select

return 0
end function
'______________________________________________________________________________

sub winmain()

Dialog(0, 0, 155, 30, "edit EM_GETLINE", WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU | DS_CENTER, WS_EX_LEFT)
EditText("123456", Edit01, 05, 05, 80, 10)
Ltext("try choice 1, 2, 3 in code", lText01, 5, 18, 100, 10, SS_NOTIFY, ws_ex_staticedge, 0) 'ws_ex_windowedge) 'ws_ex_clientedge) 'ws_ex_staticedge)
PushButton("&close" , IDCANCEL, 110, 5, 40, 10)
AutoCheckBox("topmost" , CheckboxTopMost, 110, 18, 40, 10)
CreateModalDialog(null, @DialogProc, 0)

end sub
'______________________________________________________________________________

winmain()
'______________________________________________________________________________
'


#2
OxygenBasic / Re: word WordValue at strptr(s...
Last post by Charles Pegge - Yesterday at 11:11:59 AM
Yes Pierre, this is normal behavior when setting up a pointer variable, then assigning values to it. Are you working with wide strings?
#3
OxygenBasic / Re: word WordValue at strptr(s...
Last post by Zlatko Vid - Yesterday at 10:35:39 AM
hey Pierre

i think that this is not valid  ???

word WordValue at strptr(sText) = CharCount
but this should be i am not sure 7 nulls

'pierre
word CharCount = 7
string sText = nuls CharCount ' "0000000"
 
word WordValue at strptr(sText) ' CharCount

WordValue = CharCount

print stext

#4
OxygenBasic / Re: word WordValue at strptr(s...
Last post by Zlatko Vid - Yesterday at 09:23:33 AM
Hi Pierre

may i ask you why you use type WORD ?
#5
OxygenBasic / word WordValue at strptr(sText...
Last post by Pierre Bellisle - Yesterday at 06:44:18 AM
Hi Charles, 

for  EM_GETLINE...

lets say "word CharCount = 7"  and
"string sText = nuls CharCount"

then if I write 
"word WordValue at strptr(sText) = CharCount"
it won't work

I have to do it on separate lines
"word WordValue at strptr(sText)"
"WordValue = CharCount"

Is this normal behavior ?
Thanks




#6
News and Announcements / Q2-Update moved
Last post by Theo Gottwald - May 02, 2025, 10:42:30 AM
The progress in AI is remarkable. Every day brings new models and technologies, making it hard to keep up. At the same time, there are still significant limitations—mainly two.

First, with API usage, input contexts are getting larger, but output contexts remain limited and are difficult to control.
We are working on a solution to this, aiming for output contexts nearly as long as the input.
Testing is underway, but there's no release date yet.

Second, smaller local models tend to follow instructions too literally. We're developing an input sequencer to address this, but it will delay the next update.

If anyone needs an interim update, just reach out and we'll provide one.

#AIProgress #AIDevelopment #OutputContext #ModelLimitations #APIIntegration
#7
Windows API Headers / wlanapi.inc new const
Last post by Pierre Bellisle - April 29, 2025, 09:48:15 PM
in wlanapi.inc
after 
%wlan_notification_acm_adhoc_network_state_change = %wlan_notification_acm_disconnected + 1 
you may add this, note the new value for  %wlan_notification_acm_end
%wlan_notification_acm_profile_unblocked = %wlan_notification_acm_adhoc_network_state_change + 1 'Added 2025-04-09
%wlan_notification_acm_screen_power_change = %wlan_notification_acm_profile_unblocked + 1        'Added 2025-04-09
%wlan_notification_acm_profile_blocked = %wlan_notification_acm_screen_power_change + 1          'Added 2025-04-09
%wlan_notification_acm_scan_list_refresh = %wlan_notification_acm_profile_blocked + 1            'Added 2025-04-09
%wlan_notification_acm_operational_state_change = %wlan_notification_acm_scan_list_refresh + 1   'Added 2025-04-09
%wlan_notification_acm_end = %wlan_notification_acm_operational_state_change + 1                 'Added 2025-04-09
'%wlan_notification_acm_end = %wlan_notification_acm_adhoc_network_state_change + 1              'REMed 2025-04-09
#8
**English Version with Emojis:** 

**Title: How to Maximize Productivity with Google AI, OpenAI, and Grok in Your Coding Workflow 🚀💻🤖** 

In recent days, I've been working on increasingly complex projects, particularly involving AI agents. For testing and development, I primarily rely on Python 🐍🖥�, as AI models excel in that environment. During this process, I've observed notable differences between various AI models, each with their own strengths and limitations. ⚖️✨ 

Google's latest AI model is truly impressive, boasting a massive 1MB context window 📊—unmatched for generating extensive code. It can output around 60,000 characters in one go ✍️, making it ideal for writing large final scripts. Because of this, I often start my workflow with Google AI Studio 🌐🤖, especially when I need to produce comprehensive code snippets or entire functions efficiently. 

However, when it comes to troubleshooting tricky bugs 🐞🔧—those elusive issues that typically require deep dives into forums 💬, specialist sites 🌍, or even foreign-language resources 🈶—Google's AI sometimes falls short. Despite its vast knowledge base, Google's AI can be outdated in niche or complex cases 📉⚠️. That's where OpenAI's latest models, O3 and O4, shine ✨💡. Although their output length is limited and they might cut off code prematurely ✂️, their research and problem-solving capabilities are exceptional 🧠🔍. They often identify issues that Google's AI misses 🧐, making them invaluable for debugging and troubleshooting. 

Grok 3 is another noteworthy model ✅. It manages longer code better 💾, produces fewer errors ❌🚫, and has more current knowledge compared to Google's AI 📚. When Google or other models reach their limits 🚧, Grok 3 can often provide critical insights 💡 and help resolve complex problems 🧩. For advanced debugging and research tasks, OpenAI's O3 and O4 models have truly revolutionized the process 🔄🚀. You can simply paste an error message or complicated problem into O3 📝, and it reliably pinpoints issues that are nearly impossible to uncover manually 🕵��♂️. It's akin to having an expert investigator at your fingertips 🔎🤝. 

My current workflow involves leveraging OpenAI's models to analyze and diagnose problems 🧰🧠. Once I get the insights or solutions 💡, I paste them into Google AI Studio 🌎🤖 to generate polished, final code ✨📝. The result is code that typically runs smoothly and is free of errors 🔄✅. Additionally, you might consider combining Grok with OpenAI or switching between Google and OpenAI depending on the specific task 🔄🎯. While Grok lacks Google's enormous context window 🚫📊, it is often more up-to-date with recent developments 📅📰. 

Bottom line: Combining the unique strengths of these AI models can significantly improve your coding efficiency 💪💻. Recognize each model's capabilities—whether it's Google's extensive code generation 🖥�, OpenAI's superior troubleshooting 🛠�, or Grok's up-to-date knowledge 📖—to optimize your programming workflow 🚀. 

Feel free to experiment with these tools and discover the most effective combination for your projects 🧪🔍. 

#AIagents 🤖 #AICoding 💻 #OpenAIO3 💡 #GoogleAI 🌐 #Grok3 🧠 

---

**Versión en Español con Emojis:** 

**Título: Cómo Maximizar la Productividad con Google AI, OpenAI y Grok en tu Flujo de Trabajo de Programación 🚀💻🤖** 

En los últimos días, he estado trabajando en proyectos cada vez más complejos, especialmente involucrando agentes de IA 🧠🤖. Para pruebas y desarrollo, principalmente confío en Python 🐍🖥�, ya que los modelos de IA sobresalen en ese entorno. Durante este proceso, he observado diferencias notables entre varios modelos de IA, cada uno con sus propias fortalezas y limitaciones ⚖️✨. 

El último modelo de IA de Google es realmente impresionante, con una ventana de contexto de 1MB 📊—inalcanzable para generar código extenso. Puede producir alrededor de 60,000 caracteres en una sola vez ✍️, lo que lo hace ideal para escribir scripts grandes o funciones completas de manera eficiente 🌐🤖. Por eso, generalmente comienzo mi flujo de trabajo con Google AI Studio 🛠�🌟, especialmente cuando necesito producir fragmentos de código completos o funciones de manera rápida. 

Sin embargo, cuando se trata de solucionar bugs complicados 🐞🔧—esos problemas difíciles que suelen requerir una búsqueda profunda en foros 💬, sitios especializados 🌍, o incluso recursos en idiomas extranjeros 🈶—el IA de Google a veces no llega a la altura. A pesar de su vasta base de conocimientos, el IA de Google puede estar desactualizado en casos específicos o complejos 📉⚠️. Ahí es donde los últimos modelos de OpenAI, O3 y O4, brillan ✨💡. Aunque su longitud de salida es limitada y pueden cortar el código prematuramente ✂️, sus capacidades de investigación y resolución de problemas son excepcionales 🧠🔍. A menudo identifican problemas que el IA de Google pasa por alto 🧐, convirtiéndolos en herramientas valiosísimas para depuración y solución de problemas. 

Grok 3 es otro modelo destacado ✅. Maneja mejor el código largo 💾, produce menos errores ❌🚫 y tiene conocimientos más actualizados en comparación con el IA de Google 📚. Cuando Google u otros modelos alcanzan su límite 🚧, Grok 3 puede ofrecer ideas críticas 💡 y ayudar a resolver problemas complejos 🧩. Para tareas avanzadas de depuración e investigación, los modelos O3 y O4 de OpenAI han revolucionado verdaderamente el proceso 🔄🚀. Solo necesitas pegar un mensaje de error o problema complicado en O3 📝, y con fiabilidad identifica problemas que son casi imposibles de detectar manualmente 🕵��♂️. Es como tener a un investigador experto a tu alcance 🔎🤝. 

Mi flujo de trabajo actual implica utilizar los modelos de OpenAI para analizar y diagnosticar problemas 🧰🧠. Una vez que obtengo las ideas o soluciones 💡, las pego en Google AI Studio 🌎🤖 para generar código refinado y final ✨📝. El resultado es un código que generalmente funciona sin problemas y sin errores 🔄✅. Además, puedes considerar combinar Grok con OpenAI o alternar entre Google y OpenAI según la tarea específica 🔄🎯. Aunque Grok no tiene la enorme ventana de contexto de Google 🚫📊, a menudo está más actualizado con los avances recientes 📅📰. 

En resumen: combinar las fortalezas únicas de estos modelos de IA puede mejorar significativamente tu eficiencia en programación 💪💻. Reconoce las capacidades de cada uno—ya sea la generación extensa de código de Google 🖥�, la mejor resolución de problemas de OpenAI 🛠�, o los conocimientos actualizados de Grok 📖—para optimizar tu flujo de trabajo de programación 🚀. 

Siéntete libre de experimentar con estas herramientas y descubrir la combinación más efectiva para tus proyectos 🧪🔍. 

#AgentesIA 🤖 #CodificaciónIA 💻 #OpenAIO3 💡 #GoogleAI 🌐 #Grok3 🧠

#9
OxygenBasic Examples / Re: Oxy Independent asm (old)
Last post by Frank Brübach - April 21, 2025, 10:25:32 PM

hello charles, made this example works. just for fun..
usage: compile/compile and run binary32
output: two mesage boxes and display a command line..

  ' only an experimental test, 21-04-2025, frank brübach
  ' and it works :-)

  #file "indep1d.exe" 'independent -> no need for it

  '------
  'PROLOG
  '======

' I have added -------------- //

    def _epilog 'FOR EXE
    ====================

    ._end_

    mov edi,eax 'hold exit value in edi
    push 0 'place for exit code
    mov eax,esp
    push eax
    call getModuleHandle
    push eax
    call GetExitCodeProcess
    mov eax,edi 'return exit value in eax
    push eax
    call ExitProcess

    ._error_

    push 0x30
    "MISSING OR UNLOADABLE"
    push eax
    push ecx
    push 0
    call [ebx+472]
    mov eax,0
    jmp _end_

    end def 'eplilog for exe
' I have added -------------- //


mbox "hello" ' only for test purpose

  push ebx : push esi : push edi : push ebp
  mov ebp,esp
  sub esp,256

  '--------------------------------------------------------------
  'MOVE BOOTSTRAP PROCEDURE POINTERS TO RUNTIME LIBRARY POSITIONS
  '==============================================================
  '
  'GET ABSOLUTE ADDRESSES
  '
  call fwd here
  .here
  pop eax
  sub eax,here
  mov ebx,eax : add ebx,bssdata
  mov edi,eax : add edi,import_address_table
  '
mbox "hello2" ' only for test purpose

  '--------------------------------
  'COPY BOOTSTRAP LIBRARY ADDRESSES
  '================================
  '
  mov eax,[edi+00] : mov [ebx+024],eax 'LoadLibrary
  mov eax,[edi+04] : mov [ebx+040],eax 'GetProcAddress
  mov eax,[edi+08] : mov [ebx+032],eax 'FreeLibrary
  mov eax,[edi+12] : mov [ebx+440],eax 'GetModuleHandle
  mov eax,[edi+16] : mov [ebx+448],eax 'GetGetCommandLine
  mov eax,[edi+20] : mov [ebx+456],eax 'GetExitProcess
  mov eax,[edi+24] : mov [ebx+464],eax 'ExitProcess
  mov eax,[edi+28] : mov [ebx+480],eax 'CreateFileA
  mov eax,[edi+32] : mov [ebx+488],eax 'Readfile
  mov eax,[edi+36] : mov [ebx+496],eax 'CloseHandle
  mov eax,[edi+44] : mov [ebx+472],eax 'MessageBoxA

  '=============
  jmp fwd endlib
  '=============

mbox "hello3" ' only for test purpose

  '-----------
  TestMessage:
  '===========
  push 0
  "title dolphin"
  push eax
  "message ocean"
  push eax
  push 0
  call [ebx+472]
  ret

  '------------------
  DisplayCommandLine:
  '==================
  push 0
  "COMMAND LINE"
  push eax
  call [ebx+448]
  push eax
  push 0
  call [ebx+472]
  ret

  '-------
  Message:
  '=======
  pop edi
  call [ebx+472]
  push edi
  ret 16
 
  '======
  endlib:
  '======

  '-----
  'TESTS
  '=====

  call TestMessage
  call DisplayCommandLine
  call Message 0,"message oxygen","title o2h",1

mbox "ok4"
 
  '------
  'EPILOG
  '======
  endprog:
  mov esp,ebp : pop ebp : pop edi : pop esi : pop ebx
  ret

  ' ends
#10
OxygenBasic Examples / Re: Oxy Independent asm (old)
Last post by Charles Pegge - April 20, 2025, 11:35:06 PM
It is a small part of RTL32, and does not mean very much without the PE file headers specified in inc\self\hdrs.inc. It is a small set of Windows API functions required to initiate Oxygen.dll before the remaining Runtime functions are constructed.

Excellent weather for Easter day, But very quiet down here. I heard a woodpecker in the distance, which is a good sign for our local ecology.