BAM Getting the "Ext" part of an object reference - requires Eval?

madmrmax

Weeeeeee
Site Supporters
Joined
Sep 21, 2017
Messages
477
Solutions
1
Reaction score
239
Points
55
Favorite Pinball Machine
Indiana Jones (Williams)
Ok I've gone through many different posts from the past couple of years trying to figure out. It looks like I have to use Eval to get the Ext version of an object.

  • if given an object reference, call it "obj",
    • And if object is a type of object in FP and BAM which has an "Ext" part,
  • how can I get to the Ext part? Is the only way via the Eval function?
C#:
sub ModifyLight( light)
    dim lightExt

    set lightExt = Eval(light.Name & "Ext")

    light.State = BulbOn
    lightExt.SetLitColor 255, 0, 0

end sub
 
For any BAM commands that already have an Ext function, just add this line to the top of your script to enable those commands.

xBAM.CreateAllExt() ' create BAM Extension commands
 
For any BAM commands that already have an Ext function, just add this line to the top of your script to enable those commands.

xBAM.CreateAllExt() ' create BAM Extension commands
Thanks! Yup, I do use the Ext part when I have the named object handy like LeftSlingshotBulb1Ext.Brightness... but if I create a function where I pass in an object reference, there doesn't seem to be a way to get the Ext.

For example, if I call the above function (first post) with
ModifyLight LeftSlingshotBulb1

inside the ModifyLight function I can't get the "Ext" without doing the Eval.
 
Assuming you want to modify x bulbs named Bulb1 to Bulbx
Dim MyBulbs(x)
xBAM.CreateAllExt
Set MyBulb(1) = Bulb1Ext: ...
Modif x, y ' x is the number of bulb, y is what you want to do
Sub Modif(Name, What)
MyBulb(Name).SetLitColor What, 0, 0)
End Sub

Look at that -> Remove Eval
 
Thanks for the reply! As I was looking into what Rav said on that other thread (remove the need for Eval/Execute) I was reminded again that he created the "xBam.Item" function. This was perfect for my needs and it was just something that I forgot that he did it. Thanks for reminding me to look at that thread.

C#:
sub ModifyLight( light)
    dim lightExt

    set lightExt = xBAM.Item(light.Name & "Ext") 'no Eval()!

    light.State = BulbOn
    lightExt.SetLitColor 255, 0, 0

end sub
 
General chit-chat
Help Users
You can interact with the ChatGPT Bot in any Chat Room and there is a dedicated room. The command is /ai followed by a space and then your ? or inquiry.
ie: /ai What is a EM Pinball Machine?
  • No one is chatting at the moment.
  • Chat Bot Mibs Chat Bot Mibs:
    Cicero Silva has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    manstein has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    1000 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Destruck62 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    WeadlyDeapon has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    SaixXemnas has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Gege has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Fatmeatball has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    titomajo has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    daveseawater has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    rockin ray has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Citron68 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    hammerpower has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    max37170 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    OZZOLO has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    GG974 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    MSev has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    sghure has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    huik has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    ellitehaxor has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    KenF has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Mario1963 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    etherealmusic has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Snowstorm125 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    LBlackburn has left the room.
      Chat Bot Mibs Chat Bot Mibs: LBlackburn has left the room.
      Back
      Top