BASIC Developer & Support Resources > Translators


<< < (2/9) > >>

I tried to compile the regextest.bas example and received the following errors.

MBC Version 4.0-Beta3 (2018/12/09)
MBC4: Based on Linux BCX by Mike Henning (c) 2009
(c) 2009-2018 Armando Rivera with additional code (c) 2009 John Jacques

** 64 BIT VERSION **

[Lines In:20] [Lines Out:185] [Statements:12] [Time:0.01 sec's]
BCX translated regextest.bas to
Shelling Out To: g++  -Wformat -D_FORTIFY_SOURCE=2 -Wno-write-strings -ldl  -o regextest In function ‘int main(int, char**)’: error: ‘REGEX’ does not name a type; did you mean ‘REG_ERR’?
   static   REGEX  hits;
            REG_ERR error: ‘hits’ was not declared in this scope
           ^~~~ note: suggested alternative: ‘puts’
           puts error: ‘bcxregex’ was not declared in this scope
   if(bcxregex(Src,"( )", &hits))

Give me a few minutes....

Sorry, the problem is here:

--- Code: C --- if(bcxregex(Src,"( )", &hits))
I changed that function to 'regmatch'.

You also need to put in something to search for, as is it will search for a space.

Could you please post your working version? I'm still getting errors.


--- Code: Text ---$EXECON$NOMAIN FUNCTION main(argc as integer, argv as PCHAR*) as integer    dim hits as REGEX    LOCAL Src$,j     Src$ = "Hello, World! This is Armando"    IF regmatch(Src$,"(H.+,).+(man)",&hits) THEN        FOR j = 1 TO hits.count            IF LEN(hits.results[j]) THEN                PRINT hits.results[j]$,SPC$;            END IF        NEXT        PRINT    END IFEND FUNCTION 


[0] Message Index

[#] Next page

[*] Previous page

Go to full version