jondecker76

Forum Replies Created

Viewing 13 posts - 61 through 73 (of 73 total)
  • Author
    Posts
  • in reply to: BUG compiling from some folders #1545

    jondecker76
    Participant

    is this the same as my issue here?: http://monkey2.monkey-x.com/forums/topic/module-woes/

    in reply to: Preprocessor directives for OS? #1542

    jondecker76
    Participant

    Thanks!

    in reply to: Error: Missing Return Statements #1480

    jondecker76
    Participant

    yeah, I thought of that too.  Just kind of goofy.  I’m going to do a bug report on it, as it doesn’t seem quite right!

    in reply to: Need help with Lists (code sample included) #1478

    jondecker76
    Participant

    Ok, got it to compile and did a quick test.  Looks like it’s working.

     

    It’s going to take a bit of time to get used to the new syntax!

    in reply to: Need help with Lists (code sample included) #1473

    jondecker76
    Participant

    Ok. changed the bad #endif and recompiled.

    I just realized that Last is implemented as a property instead of a method (kind of strage)!  That’s my main problem!  Going to see if I can get it to compile now…

    in reply to: Need help with Lists (code sample included) #1469

    jondecker76
    Participant

    Aaah, thanks!  I must have misunderstood the intent of “inline”

     

    Anyways, pretty simple class I’m trying to convert…  I just can’t for the life of me figure out how to do anything with an object on the top of the list.  I keep getting the following error:

    error: Type ‘SequenceStep’ cannot be invoked

    I get my first error on line 61

    in reply to: Need help with Lists (code sample included) #1465

    jondecker76
    Participant

    attached images..  This shows my newlines and whitespace showing correctly using the “<>” link above.

    After adding it, you can see in the next picture that all formatting disappears!

    in reply to: Need help with Lists (code sample included) #1464

    jondecker76
    Participant

    No, just the code portion of the post.  very strange

    in reply to: Need help with Lists (code sample included) #1462

    jondecker76
    Participant

    That’s what I’m using.  I paste in the code, then when it appears in the textbox all newlines are removed

    in reply to: Need help with Lists (code sample included) #1460

    jondecker76
    Participant

    </p><p>#rem monkeydoc<br />\##Simple Sequencing Engine<br />This module provides a simple sequencing engine implementation. Each sequence is<br />built by any number of "steps" which can be handled in the order they were created.<br />Each step has convenience methods to assign/track integer step identifiers, store and retrieve a data object,<br />expire steps as well as track/set initialization of each sequence step. Steps operate on a simple<br />FIFO stack, and the functions and methods provided primarily work on the currently active step<br />(which is on top of the stack).<br />#end<br />'Namespace jmd.sequence</p><p>#Rem monkeydoc Sequence class<br />This is the main type you will be dealing with<br />#end<br />#Import "<std>"</p><p>Using std..</p><p>Class Sequence<br />'List of sequence steps<br />Field steps:List<SequenceStep> = New List<SequenceStep></p><p>#Rem monkeydoc<br />Create a new sequence<br />alternative for CreateSequence()<br />#end<br />Method New()<br />steps.Clear()<br />End</p><p>#Rem monkeydoc<br />alternative for #SequenceAdd()<br />#end<br />Method Add(stepNum:Int,thisDuration:Int=0,data:Object=Null)<br />'If Not list Then list=CreateList()<br />local a:= New SequenceStep()<br />a.info=stepNum<br />a.init=False<br />a.data=data<br />a.timestamp=Millisecs()<br />a.duration=thisDuration<br />steps.AddLast(a)<br />End Method</p><p>#Rem monkeydoc<br />alternative for #SequenceClear()<br />#End<br />Method Clear:void()<br />If (Not steps=Null)<br />steps.Clear()<br />endif<br />End</p><p>#Rem monkeydoc<br />alternative for #SequenceGet()<br />#End<br />Method Get:Int()<br />'Local a:SequenceStep<br />'If Not steps then Return 0<br />'return steps.First().info<br />Local a:SequenceStep=steps.First()<br />Return a.info<br />'Return steps.First()<SequenceStep>.info<br />End</p><p>#Rem monkeydoc<br />alternative for #SequenceData()<br />#End<br />Method Data:Object()<br />If Not steps Return Null<br />'Return steps.First().data<br />Local a:=steps.First()<br />Return a.data<br />End Method</p><p>#Rem monkeydoc<br />Move to the next sequence.<br />#end<br />Method DoNext()<br />steps.RemoveFirst()<br />End Method</p><p>#Rem monkeydoc<br />bbdoc: alternative for #SequenceInit()<br />#End<br />Method Init:Bool()<br />If Not steps Return 0<br />Local a:=steps.First()<br />Local b:Bool = a.init<br />a.init=True<br />Return b<br />End Method</p><p>#Rem monkeydoc<br />alternative for #SequenceReInit()<br />#End<br />Method ReInit()<br />steps.First().init=False<br />End Method</p><p>#Rem monkeydoc<br />alternative for #SequenceCount()<br />#End<br />Method Count:Int()<br />Return steps.Count()<br />End Method</p><p>#Rem monkeydoc<br />alternative for #SequenceAutoExpire()<br />#End<br />Method AutoExpire()<br />If Self.Expire() Then Self.DoNext()<br />End Method</p><p>#Rem monkeydoc<br />alternative for #SequenceExpire()<br />#End<br />Method Expire:Int()<br />Local a:SequenceStep<br />Local deltaT:Int=Millisecs()-steps.First().timestamp<br />Local dur:Int = steps.First().duration</p><p>If deltaT > dur And dur>0<br />Return True<br />Else<br />Return False<br />EndIf<br />End Method</p><p>#Rem monkeydoc<br />alternative for #CreateSequence()</p><p>Function Create:Sequence()<br />Local a:Sequence<br />a = New Sequence<br />a.list=CreateList()<br />Return a<br />End Function<br />#end</p><p>End</p><p>#rem monkeydoc SequenceStep class<br />This type is used behind the scenes by the #TSequence type to store information about<br />each step in the sequence. You should never have to deal with this class directly.<br />#end<br />Class SequenceStep<br />'Initialization tracking<br />Field init:Bool<br />'Step info (normally step number)<br />Field info:Int<br />'Additional data to store with step<br />Field data:Object<br />'Autotimeout, True/False<br />Field autotimeout:Bool<br />'Millisecs timestamp at creation of step<br />Field timestamp:Int<br />'Duration of this step, in Millisecs.<br />'<1 is infinite duration<br />Field duration:Int</p><p>Method New()</p><p>end<br />End</p><p>

    in reply to: Need help with Lists (code sample included) #1459

    jondecker76
    Participant

    Looks like I also need help pasting code?  I’ve now copied from Ted2 and Gedit with the same result of newlines being ignored…

    in reply to: Need help with Lists (code sample included) #1458

    jondecker76
    Participant

    Well that didn’t work well.. Let me try that code block again

     

    #rem monkeydoc \##Simple Sequencing Engine This module provides a simple sequencing engine implementation. Each sequence is built by any number of “steps” which can be handled in the order they were created. Each step has convenience methods to assign/track integer step identifiers, store and retrieve a data object, expire steps as well as track/set initialization of each sequence step. Steps operate on a simple FIFO stack, and the functions and methods provided primarily work on the currently active step (which is on top of the stack). #end Namespace jmd.sequence #Rem monkeydoc Sequence class This is the main type you will be dealing with #end #Import <std> Using std.. Class Sequence List of sequence steps Field steps:List<SequenceStep> = New List<SequenceStep> #Rem monkeydoc Create a new sequence alternative for CreateSequence() #end Method New() steps.Clear() End #Rem monkeydoc alternative for #SequenceAdd() #end Method Add(stepNum:Int,thisDuration:Int=0,data:Object=Null) If Not list Then list=CreateList() local a:= New SequenceStep() a.info=stepNum a.init=False a.data=data a.timestamp=Millisecs() a.duration=thisDuration steps.AddLast(a) End Method #Rem monkeydoc alternative for #SequenceClear() #End Method Clear:void() If (Not steps=Null) steps.Clear() endif End #Rem monkeydoc alternative for #SequenceGet() #End Method Get:Int() Local a:SequenceStep If Not steps then Return 0 return steps.First().info Local a:SequenceStep=steps.First() Return a.info Return steps.First()<SequenceStep>.info End #Rem monkeydoc alternative for #SequenceData() #End Method Data:Object() If Not steps Return Null Return steps.First().data Local a:=steps.First() Return a.data End Method #Rem monkeydoc Move to the next sequence. #end Method DoNext() steps.RemoveFirst() End Method #Rem monkeydoc bbdoc: alternative for #SequenceInit() #End Method Init:Bool() If Not steps Return 0 Local a:=steps.First() Local b:Bool = a.init a.init=True Return b End Method #Rem monkeydoc alternative for #SequenceReInit() #End Method ReInit() steps.First().init=False End Method #Rem monkeydoc alternative for #SequenceCount() #End Method Count:Int() Return steps.Count() End Method #Rem monkeydoc alternative for #SequenceAutoExpire() #End Method AutoExpire() If Self.Expire() Then Self.DoNext() End Method #Rem monkeydoc alternative for #SequenceExpire() #End Method Expire:Int() Local a:SequenceStep Local deltaT:Int=Millisecs()-steps.First().timestamp Local dur:Int = steps.First().duration If deltaT > dur And dur>0 Return True Else Return False EndIf End Method #Rem monkeydoc alternative for #CreateSequence() Function Create:Sequence() Local a:Sequence a = New Sequence a.list=CreateList() Return a End Function #end End #rem monkeydoc SequenceStep class This type is used behind the scenes by the #TSequence type to store information about each step in the sequence. You should never have to deal with this class directly. #end Class SequenceStep Initialization tracking Field init:Bool Step info (normally step number) Field info:Int Additional data to store with step Field data:Object Autotimeout, True/False Field autotimeout:Bool Millisecs timestamp at creation of step Field timestamp:Int Duration of this step, in Millisecs. <1 is infinite duration Field duration:Int Method New() end End

    in reply to: When is Ted2 IDE coming out ? #1281

    jondecker76
    Participant

    I’m one of the minimalists that would love to use Ted2 – looking forward to it!

Viewing 13 posts - 61 through 73 (of 73 total)