In MapBasic 2019, I am trying to do a number of Create Frame commands in a Layout through a Loop. I need to be able to refer to these Frames later with LayoutItemID commands, so I need to use the Frames' Names.
It appears that you can only have a static quoted name, such as "Myframe", in the Name clause, but I need to be able to have different Names as the Loop creates the frames. I have tried adding a counting variable z in the Name clause such as Name "Myframe"+z, but this doesn't seem to work. When I do the LayoutItemID, I get a -1 result meaning it didn't work. Anyone know how I can do this?
Here is my code portion:
For z=1 to PagesNeeded
y=y+1
Add Designer Page Window LayoutNum
Set Layout Window LayoutNum Page y
Create Frame
Into Window LayoutNum
(0.3,0.701) (10.751,8.009)
Name "Myframe"+z
FillFrame On
Set Designer Frame
Window LayoutNum
ID 2
From Window FiftyPBrowseNum
iMapFrameID=LayoutItemID(LayoutNum, "Myframe"+z, LAYOUT_ITEM_TYPE_MAPPER)
Print "iMapFrameID Browser = "+iMapFrameID
iMapFrameWinID=LayoutItemInfo(LayoutNum, iMapFrameID, LAYOUT_ITEM_INFO_WIN)
Print "iMapFrameWinID Browser = " + iMapFrameWinID
Set Browse Window iMapFrameWinID Column Resize
Next
Thanks,
Sam
------------------------------
S W
Knowledge Community Shared Account
------------------------------