GameMonkey Script

GameMonkey Script Forums
It is currently Tue Oct 23, 2018 3:44 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed May 26, 2010 11:30 am 
Offline

Joined: Wed May 26, 2010 11:08 am
Posts: 4
Hello,
I'm new to GM.
I'm trying to get it running under C++ Builder (had to slightly modify some files).
Nevertheless, I've noticed, that there is a bug in implementation of the minimal client.
If there is a runtime error it the script (for instance when the code is attempting
to multiply two strings),

Code:
global ble = function()
{
   apple="appp";
   orange="orang";
   dodo=apple*orange;
   print(dodo);
};
ble();


then runtime error messages are not displayed by default implementation.

I've fixed that by slightly modifying the code:

Code:
...
    while(1)
    {
      int more=machine->Execute(deltaTime);
      // Update delta time
      int curTime = timeGetTime();
      deltaTime = curTime - lastTime;
      lastTime = curTime;

      // Dump run time errors to output
      bool first = true;
      const char * message;
      while((message = machine->GetLog().GetEntry(first)))
      {
        fprintf(stderr, "%s"GM_NL, message);
      }
      machine->GetLog().Reset();
      if(!more) break;
    }
...


Hope it helps...


Top
 Profile  
Reply with quote  
PostPosted: Thu May 27, 2010 12:20 am 
Offline

Joined: Mon Dec 15, 2003 1:38 pm
Posts: 707
Welcome to the forum xaxa :)

Thank you for reporting that issue. The semi-minimal example exited before all errors were logged. I've changed my build and also added a line 'machine->SetDebugMode(true);' enabling debug mode so that error messages are more readable.


Top
 Profile  
Reply with quote  
PostPosted: Thu May 27, 2010 5:39 pm 
Offline

Joined: Wed May 26, 2010 11:08 am
Posts: 4
Greg wrote:
Thank you for reporting that issue.

It was my pleasure.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group