+ Reply to Thread
Results 1 to 4 of 4

Thread: Nil Value problem EGATE-2

  1. #1
    Wire Noob Raf M's Avatar
    Join Date
    Apr 2008
    Posts
    8

    Unhappy Nil Value problem EGATE-2

    Hey guys,

    I just started a new script for a console screen, so i tried to convert string to ASCII & output it on the screen
    Here's what i had:
    Code:
    @name LASER OS 2.0 by depth08/The_Raf
    @inputs Clk Key Reset Console:wirelink
    @outputs Reset
    @persist A Print:string PrintColor
    
    PrintColor=161
    Print="hellowwworld"
    
    if (Word==0) {
    Char=toByte(Print,A)
    Console:writeCell(2*A-2,Char)
    Console:writeCell(2*A-1,PrintColor)
    A+=1 interval(2)
    if (A==Print:length()) {Word==1}
    }
    But the problem is,
    Code:
    timer error includes extensions math lua 66 attempt compare nil number
    That ^

    When i update my gate, everything goes just fine, i see my string appear on the screen, but after a while, the error pops up, & the screen goes dead. reloading the chip doesn't work.
    I have to make a new screen in order to let the system work [& crash] again

    I've already figured out 1 thing, the smaller the interval, the faster the character display, but also, the faster the error comes up again.

    I'm out of ideas, can anybody figure it out for me??

  2. #2
    Wirererer SoundKiller777's Avatar
    Join Date
    Dec 2008
    Location
    United Kingdom
    Posts
    191

    Default Re: Nil Value problem EGATE-2

    Hello, not sure if this will help, but have u tried replacing "(word==0)" with "(!word)"

    Not even sure if this will work sorry . But im in the processes of learning EG2 so forgive me if i have just lost my remaining dignity. lol.

  3. #3
    Spucatum Tauri Bull's Avatar
    Join Date
    Jun 2008
    Location
    Finland
    Posts
    6,009

    Default Re: Nil Value problem EGATE-2

    {Word==1}
    You can't do that.
    It should be {Word=1}

    And you should set A to 1 before you begin.
    Otherwise Char=toByte(Print,A) is trying toByte the 0th character of your string.
    Which obviously isn't possible.
    My signature has a point.
    Quote Originally Posted by Squeakyneb View Post
    when l3ulletje says do it, do it.
    That

    Quote Originally Posted by Anticept View Post
    By the way, Bull is in charge.

  4. #4
    Expressionism 2.0 Syranide's Avatar
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    4,573

    Default Re: Nil Value problem EGATE-2

    Quote Originally Posted by Raf M View Post
    Hey guys,

    I just started a new script for a console screen, so i tried to convert string to ASCII & output it on the screen
    Here's what i had:
    Code:
    @name LASER OS 2.0 by depth08/The_Raf
    @inputs Clk Key Reset Console:wirelink
    @outputs Reset
    @persist A Print:string PrintColor
     
    PrintColor=161
    Print="hellowwworld"
     
    if (Word==0) {
    Char=toByte(Print,A)
    Console:writeCell(2*A-2,Char)
    Console:writeCell(2*A-1,PrintColor)
    A+=1 interval(2)
    if (A==Print:length()) {Word==1}
    }
    But the problem is,
    Code:
    timer error includes extensions math lua 66 attempt compare nil number
    That ^

    When i update my gate, everything goes just fine, i see my string appear on the screen, but after a while, the error pops up, & the screen goes dead. reloading the chip doesn't work.
    I have to make a new screen in order to let the system work [& crash] again

    I've already figured out 1 thing, the smaller the interval, the faster the character display, but also, the faster the error comes up again.

    I'm out of ideas, can anybody figure it out for me??
    Please provide copies of the error messages, and not just "something similar". Anyway, the problem is when it's calling interval(N)... for some reason, the interval-implementation doesn't receive an argument (NIL). I have never heard of this before and can't really see how it could ever happen. But more the interval(2), to somewhere else.

    If that error message is what it looks like.

+ Reply to Thread

Similar Threads

  1. Bouncing Ball (ConsoleScreen + Egate)
    By 3dfactor in forum Finished contraptions
    Replies: 3
    Last Post: 09-05-2008, 07:31 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots