Results 1 to 3 of 3

Thread: when statements

  1. #1
    Low Bitrate GadgetBandit's Avatar
    Join Date
    Oct 2008
    Posts
    100

    when statements

    <when year="XXXX" month="XX" day="XX" hour="XX" minute="30" second="XX">

    any way to substitute a variable?

    <when year="XXXX" month="XX" day="XX" hour="XX" minute="var" second="XX">

    or

    <when "var">

    and if that's possible, how do you concatenate strings?

    Thanks,
    GadgetBandit

  2. #2
    JiC
    JiC is offline
    Newbie
    Join Date
    Sep 2008
    Posts
    26
    <whens> look like this:
    Code:
            <boolean_operation type="and">
              <parameter1>
                <boolean_operation type="equal to">
                  <parameter1>
                    <variable do="get" name="mpp"></variable>
                  </parameter1>
                  <parameter2>
                    <number>1</number>
                  </parameter2>
                </boolean_operation>
              </parameter1>
              <parameter2>
                <boolean_operation type="less than">
                  <parameter1>
                    <analogue id="SWC" time="0"></analogue>
                  </parameter1>
                  <parameter2>
                    <number>0.2</number>
                  </parameter2>
                </boolean_operation>
              </parameter2>
            </boolean_operation>
    if mpp==1 && SWC < 0.2 then ...


    I'm definitely not the expert, but I don't think you'll be able to find things like date and string manipulation in the Fusion environment.

    I think a better way would be to do your logic in another program, then have it use the COM interface to trigger digital outputs or whatever it is you're after.

  3. #3
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,049
    Quote Originally Posted by GadgetBandit View Post
    <when year="XXXX" month="XX" day="XX" hour="XX" minute="30" second="XX">

    any way to substitute a variable?

    <when year="XXXX" month="XX" day="XX" hour="XX" minute="var" second="XX">

    or

    <when "var">

    and if that's possible, how do you concatenate strings?

    Thanks,
    GadgetBandit
    Your when is correct, and it works that way even with "3X" it will be at anything that starts with '3' and so on. As for using a variable, I suppose I could add that, I hadnt thought of it. Luckily I coded it very generically so it should be relatively easy.

    Only problem is the main source is currently broken. I am working on a huge under-the-hood improvement for USB communication, and that means the program is non-functional. Once I get it back up and running, I will add this easily.

    The when "var" wont be possible right now. It is possible, but it will take quite a bit of time, I will add it to the list.
    Fusion Brain Version 6 Released!
    1.9in x 2.9in -- 47mm x 73mm
    30 Digital Outputs -- Directly drive a relay
    15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
    Buy now in the MP3Car.com Store

Similar Threads

  1. Variable syntax questions
    By Iamthehor in forum FB Software
    Replies: 14
    Last Post: 02-25-2009, 10:58 PM
  2. Suggested reading to better understand graphical interface
    By Dagwood in forum FB Documentation and Tutorials
    Replies: 6
    Last Post: 09-24-2008, 10:12 AM
  3. police laptop\radio frequency
    By jdogg1583 in forum Hardware Development
    Replies: 63
    Last Post: 03-31-2008, 05:32 PM
  4. So...America IS hated?
    By sdashiki in forum Off Topic
    Replies: 48
    Last Post: 09-09-2005, 11:21 AM

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
  •