Recent posts

#61
OxygenBasic / Re: version 0.9.0 2025-04-04 i...
Last post by Zlatko Vid - April 05, 2025, 11:01:52 AM
and what is NOW wrong with $ filename "name"  :o
do we must complicate things without reason.
#62
OxygenBasic / Re: version 0.9.0 2025-04-04 i...
Last post by Roland Stowasser - April 05, 2025, 09:56:15 AM
When studying the code of pcre_test.o2bas I found that I missed some innovations.
"uses pcre_test.res" is an interesting option.

It also seems to be possible to create an executable without using $filename "Name". I will keep this procedure. But what command can I use to create pcre_test.exe without using $filename?
#63
General Discussion / Re: José fallen into the recyc...
Last post by José Roca - April 04, 2025, 06:49:19 PM
For example, I have just finished a function to extract substrings.

' ========================================================================================
PRIVATE FUNCTION wstrExtract (BYREF wszSourceString AS CONST WSTRING, BYREF wszMatchString AS CONST WSTRING, BYVAL IgnoreCase AS BOOLEAN = TRUE) AS DWSTRING
   IF wszSourceString = "" OR wszMatchString ="" THEN RETURN wszSourceString
   DIM pRegExp AS CRegExp
   pRegExp.Global = FALSE
   pRegExp.IgnoreCase = IgnoreCase
   ' // This pattern matches the delimiter passed (can consist of a group of one or more characters)
   ' // Passing wszMatchString enclosed between "[]" will match any of the individual characters
   pRegExp.Pattern = "^(.*?)" & wszMatchString
   SetLastError(pRegExp.Execute(wszSourceString))
   iF pRegExp.SubMatchesCount THEN
      RETURN STRPTR(pRegExp.SubMatchValue(0, 0))
   END IF
   ' // If wszMatchString is not found return all of wszSourceString
   RETURN wszSourceString
END FUNCTION
' ========================================================================================

DIM dws AS DWSTRING = "abacadabra"
Print wstrExtract(dws, "cad")
' Output: aba - match on "cad"

DIM dws AS DWSTRING = "abacadabra"
Print wstrExtract(dws, "[dr]")
' Output: abaca - match on "d"

The difference is that to search for individual characters to match, you enclose them between "[]": "[dr]" will search for d or r; "cad" will search for "cad".

The same function can be used for different purposes and can be case-sensitive or insensitive.

Now I will write an overloaded function with two delimiters to extract text between them.
#64
General Discussion / Re: José fallen into the recyc...
Last post by José Roca - April 04, 2025, 06:28:48 PM
It is a work in progress, subject to numerous changes. It is better to look at my repository in GitHub. Otherwise, Google and company will return code that is outdated.

I'm finishing the include file that contain the string functions, now prefixed as "wstr" ("wcs" is already used by Microsoft). The ones that aren't complicated or that need speed, are hard coded; the ones that are complex or with many variations (case-sensitive, case-insensitive, single delimiters or ANY delimiters, local or global), are being coded using my wrapper class CRegExp and regular expressions patterns. This way, I can have only one function instead of 4 or 6.

Additionally, besides the ready to use string functions, you can use the CRegExp class to write your own code or procedures if what you need is not covered by these ready to use functions. You only need to find the appropriate pattern. This is where the AI can help. I'm unable to remember how to construct these darn patterns.

Thanks for your interest.
#65
General Discussion / José fallen into the recycle b...
Last post by Charles Pegge - April 04, 2025, 04:46:28 PM
I've been following José's postings and got a surprise!

https://forum.it-berater.org/index.php/topic,6892.0.html
#66
OxygenBasic / Re: version 0.9.0 2025-04-04 i...
Last post by Charles Pegge - April 04, 2025, 04:31:55 PM
I found the source of the problem, which emerged when I converted console print from a function to a macro

print g_S(1) space(30-len(g_S(1))) " >> " g_S(2) cr

updated here:
https://forum.it-berater.org/index.php/topic,6897.msg28636/topicseen.html#msg28636
#67
OxygenBasic / Re: version 0.9.0 2025-04-04 i...
Last post by Roland Stowasser - April 04, 2025, 04:13:30 PM
I do not know if this is helpful, but I used co2.exe 32-bit to create the 64-bit exe file (I had to add: $filename "pcre_test.exe" at the start of the program) This exe seems to work correctly.


#68
OxygenBasic / Re: ver 0.9.0 issue
Last post by Charles Pegge - April 04, 2025, 02:38:16 PM
At last I've fixed THE issues with redim and macro which caused problems with your autosizing and Tetris demos.

The only change that needs to be made is to reformat the single liner types in demos\WinGUI\Autosizing\Demo7dlg.o2bas. Colons in types are no longer supported. Just use commas. but for easier reading, the larger types should be presented in the standard block format.

type TCITEM int mask,dwState,dwStateMask, char* pszText, int cchTextMax,iImage, sys lParam

typedef TCITEM TC_ITEM

type TBADDBITMAP , sys hInst , sys  nID

type TBBUTTON , int iBitmap , int idCommand , BYTE fsState , BYTE fsStyle , dword dwData , sys iString

Further update fixing James' console print problem. Macros handling complex expression params:

#69
OxygenBasic / version 0.9.0 2025-04-04 issue...
Last post by James C. Fuller - April 04, 2025, 02:14:29 PM
Charles,
  The attached compiles fine with 0.9.0 2025-04-04 but the output is not correct.
Compiled with 0.9.0 2025-04-01 the output is correct.

James
#70
OxygenBasic / Re: ver 0.9.0 issue
Last post by Roland Stowasser - April 04, 2025, 01:24:09 AM
I get strange messages:

Edge:
Hmmm...diese Seite ist leider nicht erreichbar
Überprüfen Sie, ob in ai-studio ein Tippfehler vorliegt.

Im Web nach ai-studio suchen

Another Browser:

Diese Website ist nicht erreichbar
Prüfe, ob ,,ai-studio" einen Tippfehler enthält.

Wenn die URL keinen Tippfehler enthält, kannst du die Windows-Netzwerkdiagnose durchführen.
DNS_PROBE_FINISHED_NXDOMAIN

Heading:
Website not safe