Pages: « 1 2
  Print  
Author Topic: Lots of compile errors  (Read 3006 times)
Offline (Male) Goombert
Reply #15 Posted on: June 16, 2016, 05:14:32 AM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3110

View Profile
Running in debug mode should tell you the variables name in a popup window.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Male) Yambam
Reply #16 Posted on: June 16, 2016, 10:03:15 AM

Member
Location: The Netherlands
Joined: May 2016
Posts: 66

View Profile WWW
Running in debug mode should tell you the variables name in a popup window.
I don't see anything. I even made a test program with an nonexistent variable, but it doesn't give any error! ???
Logged

Offline (Male) Yambam
Reply #17 Posted on: June 17, 2016, 11:46:17 AM

Member
Location: The Netherlands
Joined: May 2016
Posts: 66

View Profile WWW
I mean, I don't see any popup window or so. The game doesn't even reach a draw event, it shows the error in the create event.
Logged

Offline (Male) Goombert
Reply #18 Posted on: June 17, 2016, 05:50:51 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3110

View Profile
I found the topic where I announced when I added it:
http://enigma-dev.org/forums/index.php?topic=1915

Does the error message look like that? It looks like I never got around to adding the actual variable names as debug symbols.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Male) Yambam
Reply #19 Posted on: June 20, 2016, 11:20:50 AM

Member
Location: The Netherlands
Joined: May 2016
Posts: 66

View Profile WWW
Yes the error looks like that. I'm not coming much further without knowing what variable is causing the problem.

The error is probably caused by something in my JSON script:
Code: [Select]
/* data_add_from_json(data,jsonstr)
 * Add data from JSON.
 */
var data,jsonstr,jsonlen,level,_char,i,str,endchar,control,searchname,_str;
data=argument[0]
jsonstr=argument[1]

with(data)
{
  jsonlen=string_length(jsonstr)
  level=1
  array=(string_char_at(jsonstr,1)="[")
  searchname=!array
 
  i=1
  while(i<=string_length(jsonstr))
  {
    _char=string_char_at(jsonstr,i)
    //show_message(searchname*"Searching name..."+"#"+string_copy(jsonstr,i-7,7))
    if _char=","
    {
      if !array
        searchname=1
      i+=1
    }
    else if string_pos(_char,"-1234567890.")
    {
      str=_char
      i+=1
      _char=string_char_at(jsonstr,i)
      while(string_pos(_char,"1234567890."))
      {
        str+=_char
       
        i+=1
        _char=string_char_at(jsonstr,i)
      }
      value[length]=real(str)
      length+=1
    }
    else if string_pos(_char,"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_1234567890$")
    {
      str=""
      while(string_pos(_char,"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_1234567890$"))
      {
        str+=_char
       
        i+=1
        _char=string_char_at(jsonstr,i)
      }
     
      if str="true"
        str=1
      else if str="false"
        str=0
      else if str="ord"
      {
        if string_char_at(jsonstr,i+1)="("
        {
          i+=2
          endchar=string_char_at(jsonstr,i)
          i+=1
          control=0
          _char=string_char_at(jsonstr,i)
          while(_char!=endchar&&i<=string_length(jsonstr))
          {
            if _char="\"
              control=1
            else
            {
              if control
              {
                if _char="r"
                  str+=chr(13)
                else if _char="n"
                  str+=chr(10)
                else if _char="t"
                  str+=chr(9)
                else if _char="\"
                  str+="\"
                else if _char='"'
                  str+='"'
                else
                  str+="\"+_char
                control=0
              }
              else
                str+=_char
            }
           
            i+=2
            _char=string_char_at(jsonstr,i)
          }
          i+=1
          _char=string_char_at(jsonstr,i)
          str=ord(str)
        }
      }
      else if string_copy(str,1,3)="vk_"
      {
        if str="vk_control"
          str=vk_control
        else if str="vk_alt"
          str=vk_alt
        else if str="vk_shift"
          str=vk_shift
        else if str="vk_rcontrol"
          str=vk_rcontrol
        else if str="vk_ralt"
          str=vk_ralt
        else if str="vk_rshift"
          str=vk_rshift
        else if str="vk_lwin"
          str=vk_lwin
        else if str="vk_rwin"
          str=vk_rwin
        else if str="vk_space"
          str=vk_space
      }
     
      if !searchname
      {
        value[length]=str
        length+=1
      }
      else
        name[length]=str
      searchname=0
    }
    else if _char='"'||_char="'"
    {
      endchar=_char
      i+=1
      _char=string_char_at(jsonstr,i)
     
      str=""
      control=0
      if endchar='"' while((_char!=endchar||control)&&i!=jsonlen)
      {
        if _char="\"
          control=1
        else
        {
          if control
          {
            if _char="r"
              str+=chr(13)
            else if _char="n"
              str+=chr(10)
            else if _char="t"
              str+=chr(9)
            else if _char="\"
              str+="\"
            else if _char='"'
              str+='"'
            else
              str+="\"+_char
            control=0
          }
          else
            str+=_char
        }
       
        i+=1
        _char=string_char_at(jsonstr,i)
      }
      else while(_char!=endchar&&i!=jsonlen)
      {
        str+=_char
       
        i+=1
        _char=string_char_at(jsonstr,i)
      }
     
      if !searchname
      {
        value[length]=str
        length+=1
      }
      else
        name[length]=str
      searchname=0
     
      i+=1
      _char=string_char_at(jsonstr,i)
    }
    else if _char="{"&&i!=1
    {
      i+=1
      _char=string_char_at(jsonstr,i)
     
      value[length]=data_from_json(string_copy(jsonstr,i,string_length(jsonstr)-i+1),id)
      length+=1
      i+=skip
    }
    else if _char="}"||_char="]"
    {
      if argument[2]!=0
        argument[2].skip=i
      break
    }
    else if _char="["&&i!=1
    {
      value[length]=data_from_json(string_copy(jsonstr,i,string_length(jsonstr)-i+1),id)
      length+=1
      i+=skip
    }
    else
      i+=1
  }
 
  return id;
}

If I press Ignore 4 times, the script ends. Maybe you could do something with that?
« Last Edit: June 20, 2016, 11:33:46 AM by Yambam » Logged

Offline (Male) Yambam
Reply #20 Posted on: July 01, 2016, 08:32:19 AM

Member
Location: The Netherlands
Joined: May 2016
Posts: 66

View Profile WWW
Could someone help me with my last post? ???

EDIT: I solved this problem, but now the problem is in this script:

Code: [Select]
/* data_copy_recursive(data)
 * Copy a data instance and all its child nodes.
 */
var data,copy,i,j;
data=argument0

with(data)
{
  copy=data_create()
  copy.length=length
  j=0
  for(i=0;i<length;i+=1)
  {
    if string_char_at(name[i],1)="<"&&string_char_at(name[i],string_length(name[i]))=">"
      continue
   
    copy.name[j]=name[i]
    if data_exists(value[i])
    {
      if name[i]="<hyperlink>"
        copy.value[j]=data_copy(value[i])
      else
        copy.value[j]=data_copy_recursive(value[i])
    }
    else
      copy.value[j]=value[i]
    j+=1
  }
  copy.length=j
 
  return copy;
}

return noone;

This is the script I use to detect an instance of data:

Code: [Select]
/* data_exists(data)
 * Check whether or not a data instance exists.
 */
var data;
data=argument0

if is_real(data) if data>=100001 if instance_exists(data) if data.object_index=obj_data
  return 1;

return 0;
« Last Edit: July 01, 2016, 09:02:00 AM by Yambam » Logged

Pages: « 1 2
  Print