Author Topic: Strange error message  (Read 2323 times)

0 Members and 1 Guest are viewing this topic.

Arnold

  • Guest
Strange error message
« on: February 15, 2015, 12:28:07 PM »
Hi Charles,

I found in examples\System\Threads in the demo together.o2bas the first lines:

Code: [Select]

  '================================================
  'MULTIPLE THREADS WITH SYNC FOR STRING PROCESSING
  '================================================

  #include "$\inc\minwin.inc"
  #define INFINITE 0xFFFFFFFF  'Infinite timeout


This results to the error:

Linker found unidentified names:
timeout:   level 0

If I use // or ; instead of ' then the demo runs ok.
And if I use rem or REM then the demo runs forever and uses increasing memory until I kill gxo2.exe with the Task-Manager. I do not know if this is the case only with my 32bit system?

Roland


Arnold

  • Guest
Re: Strange error message
« Reply #1 on: February 15, 2015, 12:31:54 PM »
And there is another small error in examples\System\SharedMem:

in the demo SharedMemClient.o2bas there is this code at about line 43:

Code: [Select]

   & pBuf = MapViewOfFile(hMapFile,   // handle to map object
          FILE_MAP_ALL_ACCESS, // read/write permission
          0,
          0,
          BUF_SIZE);

   if (& pBuf == 0) 



this results to the error:

RROR:   Too many right brackets (..))
WORD:    }
LINE:    65
FILE:    main source
PASS:    1
       

If I modify to:

   if (&pBuf == 0)

then the demo runs ok. I wonder why & pBuf = MapViewOfFile(hMapFile does work, but the second use of & pBuf does not work?




Charles Pegge

  • Guest
Re: Strange error message
« Reply #2 on: February 15, 2015, 01:29:49 PM »
Hi Roland,

Yes, #defines have become sensitive to '.. basic comments in conflict with c character literals.

These thread and shared-mem examples require additional attention.

Thanks!
« Last Edit: February 15, 2015, 01:39:45 PM by Charles Pegge »

Charles Pegge

  • Guest
Re: Strange error message
« Reply #3 on: February 15, 2015, 10:16:56 PM »
#define should no longer contain BASIC comments

but the other problems are fixed.

Oxygen Update
http://www.oxygenbasic.org/o2zips/Oxygen.zip

Arnold

  • Guest
Re: Strange error message
« Reply #4 on: February 16, 2015, 03:06:59 AM »
Hi Charles,

it is incredible how fast you can find a solution.

Unfortunately with the last build of Feb. 15. there is now an error message with some demos which was not with the o2hbuilds before e.g. in c:\oxygenbasic\examples\OpenGl:

BezierClosed1.o2bas

 ; ASM ERR:    rect rc!!  Unidentified instruction: rect
 ; AFTER:      .getclientwhxy#sys#sys#sys#sys#sys
 ; LINE:       115


getclientwhxy is in WinUtil.inc but all these demos worked ok before.

I would also like to share my observations with comments. Oxygen can recognize 5 different kind of comments: ; rem // ' /* */ (Did a forget any?). This is a lot compared with other languages which only use one or two ways to comment, sometimes only in one line. But this can of course get very complex. I tried together.o2bas with your last update using some combinations:

#define INFINITE 0xFFFFFFFF   //Infinite timeout   --> ok
#define INFINITE 0xFFFFFFFF   ; Infinite timeout   --> ok
#define INFINITE 0xFFFFFFFF   /*Infinite timeout*/   --> ok
#define INFINITE 0xFFFFFFFF   ' Infinite timeout    --> linker error --> ok
#define INFINITE 0xFFFFFFFF   rem Infinite timeout  --> linker error --> ok

#define INFINITE 0xFFFFFFFF   // ; rem '[* Infinite timeout *]  --> ok
#define INFINITE 0xFFFFFFFF   rem // ; rem '[* Infinite timeout *] --> linker error --> ok
 
#define INFINITE 0xFFFFFFFF   '// ; rem '[* Infinite timeout *]  --> too many nests, should be linker error?

#define INFINITE 0xFFFFFFFF   '//Infinite timeout   --> gxo2.exe must be killed
#define INFINITE 0xFFFFFFFF   ' //Infinite timeout   --> gives strange result

#define INFINITE 0xFFFFFFFF   rem//Infinite timeout   --> linker error --> ok

There are some more possible combinations. As a newbie I do things which I would normally not think about. But the combinagion '// and ' // should perhaps be examined. Maybe it is possible that after #define rem and ' simply return a linker error as is in some cases?

But undoing the ASM ERR is more important.

Roland

Charles Pegge

  • Guest
Re: Strange error message
« Reply #5 on: February 16, 2015, 06:26:07 AM »
Hi Roland,

I've already caught the first error.  That was a WinUtil.o2bas error rather than from the compiler itself. RECT & POINT now capitalised.

I will try to make #define ascii 39 quotemarks a little more robust, but in general, avoid using #define with Basic syntax.

Thanks
Charles

PS: if the quotemarks are not in short pairs - a Basic comment is now assumed:

Oxygen Update
http://www.oxygenbasic.org/o2zips/Oxygen.zip
« Last Edit: February 16, 2015, 07:21:51 AM by Charles Pegge »

Arnold

  • Guest
Re: Strange error message
« Reply #6 on: February 16, 2015, 08:11:02 AM »
Hi Charles,
 
with the last update the error message has gone away. Hopefully you are not annoyed about my claims which sometimes are really marginal. But as I am in a learning stage my thought is that it should not harm to notify you about what could happen. My questions are also a reminder for me what I can do and what I should avoid. If I would not be convinced of OxygenBasic's stable fundament and of your brilliant capabilities I would not say anything.

So probably I will still have some questions about OxygenBasic (maybe a handful). With nearly 800 demos this should be tolerable. Then I will be ready to be a bit more constructive / productive (hopefully).

Roland