Thank you Mark for bringing some progress to an otherwise frustrating day. I'm close to being able to say success instead of progress.
What you are saying is clear and I am getting a much better understanding. Ironically, I'm back at the same results you fixed before - returning the last item in the array instead of the current one, but this time i can see why.
Here is the slideshow sub - curr_photo is defined, then used (returning correct results) in the canvas, then passed on at the end.
Sub DisplaySlideShow(slideshow, photolist)
.......................
else if msg.isPlaybackPosition() then
onscreenphoto = msg.GetIndex()
curr_photo = photolist[onscreenphoto]
print "slideshow display: " + Stri(msg.GetIndex())
canvas = CreateObject( "roImageCanvas" )
fontReg = CreateObject("roFontRegistry")
fontReg.Register("pkg:/fonts/caps.otf")
font = fontReg.Get("caps",28,50,true)
bgRect = {
Color: "#00000000",
TargetRect: { x: 55, y: 10, w: 280, h: 50 }
}
text = {
Text: curr_photo.GetTitle(),
TextAttrs:{Color:"#960404", Font:font,
HAlign:"Left", VAlign:"VCenter", Direction:"LeftToRight"}
TargetRect: bgRect.TargetRect
}
canvas.SetLayer( 0, [ bgRect, text ] )
canvas.Show()
Sleep( 2500 )
canvas.Close()
else if msg.isRemoteKeyPressed()
if msg.GetIndex() = 10
DisplayInfoMenu(6, photo) ' Problem Line Here?
end if
..........................
DisplayInfomenu(infotype, curr_photo)
End Sub
Here is the Infomenu function:
Function DisplayInfomenu(infotype as Object, curr_photo as Object)
infomenu = createobject("romessagedialog")
infomenu.setmessageport(createobject("romessageport"))
infomenu.enableoverlay(true)
if (infotype = 6)
infomenu.setTitle(curr_photo.GetTitle())
................
This works, showing a Title in the info dialog - however it returns the last item in the array, not the current one, not too surprising since the variable used below is photo not curr_photo
else if msg.isRemoteKeyPressed()
if msg.GetIndex() = 10
DisplayInfoMenu(6, photo) ' Problem Line Here?
end if
what seems strange is that if I change it to what it should be:
DisplayInfoMenu(6, curr_photo)
I get a type mismatch on the first line of the infomenu function
311: end function
Type Mismatch. (runtime error &h18) in ...g:/source/mediarsstoolkit.brs(261)
261: Function DisplayInfomenu(infotype as Object, curr_photo as Object)
..........................
infotype &h0010 bsc:roInt, refcnt=1
curr_photo &h0000 <uninitialized> val:Uninitialized
global &h0020 rotINTERFACE:ifGlobal
m &h0010 bsc:roAssociativeArray, refcnt=4
with curr_photo showing as uninitialized.
I smell some sort of syntax fix but I'm stumped right now. Thanks to you I got somewhere today and will try again in the morning. I really appreciate the chance to learn.
Kinetics Screensavers